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 94c471e7..2d7f42f9 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 @@ -100,10 +100,11 @@ public class SysProfileController extends BaseController { return error("新密码不能与旧密码相同"); } - if (userService.resetUserPwd(userName, SecurityUtils.encryptPassword(newPassword)) > 0) + newPassword = SecurityUtils.encryptPassword(newPassword); + if (userService.resetUserPwd(userName, newPassword) > 0) { // 更新缓存用户密码 - loginUser.getUser().setPassword(SecurityUtils.encryptPassword(newPassword)); + loginUser.getUser().setPassword(newPassword); tokenService.setLoginUser(loginUser); return success(); }