update ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java.

此处新密码加密了两次,多余的操作,且会导致新生成的数据库密码与缓存中的密码不同,如果修改的不对还请讲解回复下,谢谢。

Signed-off-by: 张利 <zhangli_wei555@163.com>
This commit is contained in:
张利 2023-11-02 02:57:04 +00:00 committed by Gitee
parent d8255edf84
commit fbab383bd7
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -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();
}