diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/dubbo/RemoteUserServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/dubbo/RemoteUserServiceImpl.java index 246417e0..ca88fc2c 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/dubbo/RemoteUserServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/dubbo/RemoteUserServiceImpl.java @@ -139,8 +139,7 @@ public class RemoteUserServiceImpl implements RemoteUserService { throw new ServiceException("当前系统没有开启注册功能"); } return userMapper.exists(new LambdaQueryWrapper() - .eq(SysUser::getUserName, sysUserBo.getUserName()) - .ne(ObjectUtil.isNotNull(sysUserBo.getUserId()), SysUser::getUserId, sysUserBo.getUserId())); + .eq(SysUser::getUserName, sysUserBo.getUserName())); }); if (exist) { throw new UserException("user.register.save.error", username); diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysUserServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysUserServiceImpl.java index 4930cbcc..7b96bcb5 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysUserServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysUserServiceImpl.java @@ -315,8 +315,8 @@ public class SysUserServiceImpl implements ISysUserService { */ @Override public boolean registerUser(SysUserBo user, String tenantId) { - user.setCreateBy(user.getUserId()); - user.setUpdateBy(user.getUserId()); + user.setCreateBy(0L); + user.setUpdateBy(0L); SysUser sysUser = MapstructUtils.convert(user, SysUser.class); sysUser.setTenantId(tenantId); return baseMapper.insert(sysUser) > 0;