Commit c3a78c51 authored by 赵啸非's avatar 赵啸非

修改用户登录,权限分配等

parent 680c5f19
......@@ -75,6 +75,9 @@ public class UserServiceImpl extends AbstractCRUDServiceImpl<UserDao, UserEntity
@Override
protected void saveBefore(UserEntity entity, Context context) throws AppException {
if (!ObjectUtils.isEmpty(entity.getLoginName()) && existUser(entity.getLoginName(), entity.getId())) {
throw new AppException("登录名已存在!");
}
this.doHandlerUser(entity);
}
......
......@@ -92,16 +92,13 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic
}
@Override
protected void saveBefore(UserEntity entity, Map<String, Object> model, Context context) throws AppException {
if (service.existUser(entity.getLoginName(), entity.getId())) {
throw new AppException("登录名已存在!");
}
if (!ObjectUtils.isEmpty(entity.getLoginName()) && service.existUser(entity.getLoginName(), entity.getId())) {
throw new AppException("登录名已存在!");
}
super.saveBefore(entity, model, context);
}
// @Override
// protected void saveBefore(UserEntity entity, Map<String, Object> model, Context context) throws AppException {
// if (!ObjectUtils.isEmpty(entity.getLoginName()) && service.existUser(entity.getLoginName(), entity.getId())) {
// throw new AppException("登录名已存在!");
// }
// super.saveBefore(entity, model, context);
// }
@RequestMapping(value = "change/password", method = RequestMethod.POST)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment