|
|
|
@ -143,7 +143,7 @@ public class SysUserController extends BaseController
|
|
|
|
|
{
|
|
|
|
|
return R.fail("当前系统没有开启注册功能!");
|
|
|
|
|
}
|
|
|
|
|
if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(username)))
|
|
|
|
|
if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(sysUser)))
|
|
|
|
|
{
|
|
|
|
|
return R.fail("保存用户'" + username + "'失败,注册账号已存在");
|
|
|
|
|
}
|
|
|
|
@ -200,7 +200,7 @@ public class SysUserController extends BaseController
|
|
|
|
|
@PostMapping
|
|
|
|
|
public AjaxResult add(@Validated @RequestBody SysUser user)
|
|
|
|
|
{
|
|
|
|
|
if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(user.getUserName())))
|
|
|
|
|
if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(user)))
|
|
|
|
|
{
|
|
|
|
|
return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
|
|
|
|
|
}
|
|
|
|
@ -229,7 +229,11 @@ public class SysUserController extends BaseController
|
|
|
|
|
{
|
|
|
|
|
userService.checkUserAllowed(user);
|
|
|
|
|
userService.checkUserDataScope(user.getUserId());
|
|
|
|
|
if (StringUtils.isNotEmpty(user.getPhonenumber())
|
|
|
|
|
if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(user)))
|
|
|
|
|
{
|
|
|
|
|
return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,登录账号已存在");
|
|
|
|
|
}
|
|
|
|
|
else if (StringUtils.isNotEmpty(user.getPhonenumber())
|
|
|
|
|
&& UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user)))
|
|
|
|
|
{
|
|
|
|
|
return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,手机号码已存在");
|
|
|
|
|