diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/system/controller/user/UserController.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/system/controller/user/UserController.java index c9204a5..fc1dc33 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/system/controller/user/UserController.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/system/controller/user/UserController.java @@ -108,10 +108,11 @@ public class UserController { String oldPass = RsaUtils.decryptByPrivateKey(RsaProperties.privateKey,passVo.getString("oldPass")); String newPass = RsaUtils.decryptByPrivateKey(RsaProperties.privateKey,passVo.getString("newPass")); SysUser user = userService.getOne(new LambdaQueryWrapper().eq(SysUser::getUsername, SecurityUtils.getCurrentUsername())); - if (!SaSecureUtil.md5BySalt(user.getPassword(), "salt").equals(SaSecureUtil.md5BySalt(oldPass, "salt"))) { + + if (!user.getPassword().equals(SaSecureUtil.md5BySalt(oldPass, "salt"))) { throw new BadRequestException("修改失败,旧密码错误"); } - if (!SaSecureUtil.md5BySalt(user.getPassword(), "salt").equals(SaSecureUtil.md5BySalt(newPass, "salt"))) { + if (user.getPassword().equals(SaSecureUtil.md5BySalt(newPass, "salt"))) { throw new BadRequestException("新密码不能与旧密码相同"); } user.setPassword(SaSecureUtil.md5BySalt(newPass, "salt"));