File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
campus-admin/src/main/java/com/oddfar/campus/admin/controller/system Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -79,19 +79,20 @@ public R updateProfile(@RequestBody SysUserEntity user) {
7979 */
8080 @ PutMapping (value = "/updatePwd" , name = "个人信息管理-重置密码" )
8181 public R updatePwd (String oldPassword , String newPassword ) {
82- LoginUser loginUser = getLoginUser ();
83- String userName = loginUser .getUsername ();
84- String password = loginUser .getPassword ();
82+ SysUserEntity user = userService .selectUserById (SecurityUtils .getUserId ());
83+ // LoginUser loginUser = getLoginUser();
84+ String userName = user .getUserName ();
85+ String password = user .getPassword ();
8586 if (!SecurityUtils .matchesPassword (oldPassword , password )) {
8687 return R .error ("修改密码失败,旧密码错误" );
8788 }
8889 if (SecurityUtils .matchesPassword (newPassword , password )) {
8990 return R .error ("新密码不能与旧密码相同" );
9091 }
9192 if (userService .resetUserPwd (userName , SecurityUtils .encryptPassword (newPassword )) > 0 ) {
92- // 更新缓存用户密码
93- loginUser .getUser ().setPassword (SecurityUtils .encryptPassword (newPassword ));
94- tokenService .setLoginUser (loginUser );
93+ // // 更新缓存用户密码
94+ // loginUser.getUser().setPassword(SecurityUtils.encryptPassword(newPassword));
95+ // tokenService.setLoginUser(loginUser);
9596 return R .ok ();
9697 }
9798 return R .error ("修改密码异常,请联系管理员" );
You can’t perform that action at this time.
0 commit comments