RuoYi
2023-02-16 ade70583e9164d48dbe577c02da8d0ee22ebceaa
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
@@ -161,14 +161,15 @@
    /**
     * 校验用户名称是否唯一
     * 
     * @param userName 用户名称
     * @param user 用户信息
     * @return 结果
     */
    @Override
    public String checkUserNameUnique(String userName)
    public String checkUserNameUnique(SysUser user)
    {
        int count = userMapper.checkUserNameUnique(userName);
        if (count > 0)
        Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId();
        SysUser info = userMapper.checkUserNameUnique(user.getUserName());
        if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue())
        {
            return UserConstants.NOT_UNIQUE;
        }
@@ -507,6 +508,8 @@
                else if (isUpdateSupport)
                {
                    BeanValidators.validateWithException(validator, user);
                    checkUserAllowed(user);
                    checkUserDataScope(user.getUserId());
                    user.setUpdateBy(operName);
                    this.updateUser(user);
                    successNum++;