|
|
@ -64,6 +64,9 @@ public class SysProfileController extends BaseController |
|
|
|
@PutMapping |
|
|
|
@PutMapping |
|
|
|
public AjaxResult updateProfile(@RequestBody SysUser user) |
|
|
|
public AjaxResult updateProfile(@RequestBody SysUser user) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
LoginUser loginUser = SecurityUtils.getLoginUser(); |
|
|
|
|
|
|
|
SysUser sysUser = loginUser.getSysUser(); |
|
|
|
|
|
|
|
user.setUserName(sysUser.getUserName()); |
|
|
|
if (StringUtils.isNotEmpty(user.getPhonenumber()) |
|
|
|
if (StringUtils.isNotEmpty(user.getPhonenumber()) |
|
|
|
&& UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) |
|
|
|
&& UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -74,8 +77,6 @@ public class SysProfileController extends BaseController |
|
|
|
{ |
|
|
|
{ |
|
|
|
return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在"); |
|
|
|
return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在"); |
|
|
|
} |
|
|
|
} |
|
|
|
LoginUser loginUser = SecurityUtils.getLoginUser(); |
|
|
|
|
|
|
|
SysUser sysUser = loginUser.getSysUser(); |
|
|
|
|
|
|
|
user.setUserId(sysUser.getUserId()); |
|
|
|
user.setUserId(sysUser.getUserId()); |
|
|
|
user.setPassword(null); |
|
|
|
user.setPassword(null); |
|
|
|
if (userService.updateUserProfile(user) > 0) |
|
|
|
if (userService.updateUserProfile(user) > 0) |
|
|
|