From c0ca2f837c0f07f83f484cc40c6de6785b288bd5 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Mon, 10 Feb 2020 13:28:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=86=E7=A0=81=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E7=BC=93=E5=AD=98=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../project/system/controller/SysProfileController.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ruoyi/src/main/java/com/ruoyi/project/system/controller/SysProfileController.java b/ruoyi/src/main/java/com/ruoyi/project/system/controller/SysProfileController.java index 176a9a1..8b0b38e 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/system/controller/SysProfileController.java +++ b/ruoyi/src/main/java/com/ruoyi/project/system/controller/SysProfileController.java @@ -91,7 +91,14 @@ public class SysProfileController extends BaseController { return AjaxResult.error("新密码不能与旧密码相同"); } - return toAjax(userService.resetUserPwd(userName, SecurityUtils.encryptPassword(newPassword))); + if (userService.resetUserPwd(userName, SecurityUtils.encryptPassword(newPassword)) > 0) + { + // 更新缓存用户密码 + loginUser.getUser().setPassword(SecurityUtils.encryptPassword(newPassword)); + tokenService.setLoginUser(loginUser); + return AjaxResult.success(); + } + return AjaxResult.error("修改密码异常,请联系管理员"); } /**