diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java index a9dcce816..899c60eb6 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java @@ -71,9 +71,12 @@ public class SysProfileController extends BaseController { return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在"); } + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + SysUser sysUser = loginUser.getUser(); + user.setUserId(sysUser.getUserId()); + user.setPassword(null); if (userService.updateUserProfile(user) > 0) { - LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); // 更新缓存用户信息 loginUser.getUser().setNickName(user.getNickName()); loginUser.getUser().setPhonenumber(user.getPhonenumber());