|
|
|
@ -171,11 +171,13 @@ public class SysUserController extends BaseController
|
|
|
|
|
{
|
|
|
|
|
return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
|
|
|
|
|
}
|
|
|
|
|
else if (UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user)))
|
|
|
|
|
else if (StringUtils.isNotEmpty(user.getPhonenumber())
|
|
|
|
|
&& UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user)))
|
|
|
|
|
{
|
|
|
|
|
return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,手机号码已存在");
|
|
|
|
|
}
|
|
|
|
|
else if (UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user)))
|
|
|
|
|
else if (StringUtils.isNotEmpty(user.getEmail())
|
|
|
|
|
&& UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user)))
|
|
|
|
|
{
|
|
|
|
|
return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在");
|
|
|
|
|
}
|
|
|
|
@ -193,11 +195,13 @@ public class SysUserController extends BaseController
|
|
|
|
|
public AjaxResult edit(@Validated @RequestBody SysUser user)
|
|
|
|
|
{
|
|
|
|
|
userService.checkUserAllowed(user);
|
|
|
|
|
if (UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user)))
|
|
|
|
|
if (StringUtils.isNotEmpty(user.getPhonenumber())
|
|
|
|
|
&& UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user)))
|
|
|
|
|
{
|
|
|
|
|
return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,手机号码已存在");
|
|
|
|
|
}
|
|
|
|
|
else if (UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user)))
|
|
|
|
|
else if (StringUtils.isNotEmpty(user.getEmail())
|
|
|
|
|
&& UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user)))
|
|
|
|
|
{
|
|
|
|
|
return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在");
|
|
|
|
|
}
|
|
|
|
|