Unverified Commit ce7ececd authored by samz406's avatar samz406 Committed by GitHub
Browse files

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

更新用户名如果填写已经存在的用户名会报错。
parent a3a41ac8
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -216,6 +216,11 @@ public class UsersService extends BaseService {
        Date now = new Date();

        if (StringUtils.isNotEmpty(userName)) {
            User tempUser = userMapper.queryByUserName(userName);
            if (tempUser != null && tempUser.getId() != userId) {
                putMsg(result, Status.USER_NAME_EXIST, userId);
                return result;
            }
            user.setUserName(userName);
        }