优化用户序列化忽略密码字段

This commit is contained in:
RuoYi
2025-12-05 15:13:12 +08:00
parent 3d4c6f4fa1
commit 2aec3935fb
2 changed files with 5 additions and 2 deletions

View File

@@ -101,7 +101,8 @@ public class SysProfileController extends BaseController
String newPassword = params.get("newPassword");
LoginUser loginUser = SecurityUtils.getLoginUser();
Long userId = loginUser.getUserid();
String password = loginUser.getSysUser().getPassword();
SysUser user = userService.selectUserById(userId);
String password = user.getPassword();
if (!SecurityUtils.matchesPassword(oldPassword, password))
{
return error("修改密码失败,旧密码错误");