Browse Source

更新用户时填写已经存的用户名报错

更新用户名如果填写已经存在的用户名会报错。
pull/2/head
samz406 6 years ago committed by GitHub
parent
commit
1908e6d174
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      escheduler-api/src/main/java/cn/escheduler/api/service/UsersService.java

2
escheduler-api/src/main/java/cn/escheduler/api/service/UsersService.java

@ -218,7 +218,7 @@ public class UsersService extends BaseService {
if (StringUtils.isNotEmpty(userName)) { if (StringUtils.isNotEmpty(userName)) {
User tempUser = userMapper.queryByUserName(userName); User tempUser = userMapper.queryByUserName(userName);
if (tempUser != null && tempUser.getId() != userId) { if (tempUser != null && tempUser.getId() != userId) {
putMsg(result, Status.USER_NAME_EXIST, userName); putMsg(result, Status.USER_NAME_EXIST);
return result; return result;
} }
user.setUserName(userName); user.setUserName(userName);

Loading…
Cancel
Save