Commit c0ca2f837c0f07f83f484cc40c6de6785b288bd5
1 parent
891062a7
修改密码更新缓存信息
Showing
1 changed file
with
8 additions
and
1 deletions
ruoyi/src/main/java/com/ruoyi/project/system/controller/SysProfileController.java
| ... | ... | @@ -91,7 +91,14 @@ public class SysProfileController extends BaseController |
| 91 | 91 | { |
| 92 | 92 | return AjaxResult.error("新密码不能与旧密码相同"); |
| 93 | 93 | } |
| 94 | - return toAjax(userService.resetUserPwd(userName, SecurityUtils.encryptPassword(newPassword))); | |
| 94 | + if (userService.resetUserPwd(userName, SecurityUtils.encryptPassword(newPassword)) > 0) | |
| 95 | + { | |
| 96 | + // 更新缓存用户密码 | |
| 97 | + loginUser.getUser().setPassword(SecurityUtils.encryptPassword(newPassword)); | |
| 98 | + tokenService.setLoginUser(loginUser); | |
| 99 | + return AjaxResult.success(); | |
| 100 | + } | |
| 101 | + return AjaxResult.error("修改密码异常,请联系管理员"); | |
| 95 | 102 | } |
| 96 | 103 | |
| 97 | 104 | /** | ... | ... |