This commit is contained in:
mashuai 2025-05-07 14:12:36 +08:00
parent 836decaec0
commit a264a9c693
2 changed files with 1 additions and 3 deletions

View File

@ -268,8 +268,6 @@ public class SysUserController extends BaseController {
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
@PutMapping("/resetPwd")
public AjaxResult resetPwd(@RequestBody SysUser user) throws Exception {
Long userId = SecurityUtils.getUserId();
user.setUserId(userId);
String decrypt = RsaUtil.decryptByPrivateKey(user.getPassword(), Constants.privateKey);
//userService.checkUserAllowed(user);
userService.checkUserDataScope(user.getUserId());

View File

@ -626,7 +626,7 @@ public class SysUserServiceImpl implements ISysUserService {
throw new ServiceException("新密码不能包含超过" + systemConfig.getPasswordConfig().getMaxConsecutiveChars() + "位连续字符!");
}
// 根据用户id查询用户信息
SysUser userInfo = userMapper.selectUserById(user.getUserId());
SysUser userInfo = userMapper.selectUserById(SecurityUtils.getUserId());
boolean isNewPassword = SecurityUtils.matchesPassword(decrypt, userInfo.getPassword());
if (isNewPassword) {
throw new ServiceException("新密码不能与旧密码相同!");