This commit is contained in:
parent
836decaec0
commit
a264a9c693
|
|
@ -268,8 +268,6 @@ public class SysUserController extends BaseController {
|
||||||
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping("/resetPwd")
|
@PutMapping("/resetPwd")
|
||||||
public AjaxResult resetPwd(@RequestBody SysUser user) throws Exception {
|
public AjaxResult resetPwd(@RequestBody SysUser user) throws Exception {
|
||||||
Long userId = SecurityUtils.getUserId();
|
|
||||||
user.setUserId(userId);
|
|
||||||
String decrypt = RsaUtil.decryptByPrivateKey(user.getPassword(), Constants.privateKey);
|
String decrypt = RsaUtil.decryptByPrivateKey(user.getPassword(), Constants.privateKey);
|
||||||
//userService.checkUserAllowed(user);
|
//userService.checkUserAllowed(user);
|
||||||
userService.checkUserDataScope(user.getUserId());
|
userService.checkUserDataScope(user.getUserId());
|
||||||
|
|
|
||||||
|
|
@ -626,7 +626,7 @@ public class SysUserServiceImpl implements ISysUserService {
|
||||||
throw new ServiceException("新密码不能包含超过" + systemConfig.getPasswordConfig().getMaxConsecutiveChars() + "位连续字符!");
|
throw new ServiceException("新密码不能包含超过" + systemConfig.getPasswordConfig().getMaxConsecutiveChars() + "位连续字符!");
|
||||||
}
|
}
|
||||||
// 根据用户id查询用户信息
|
// 根据用户id查询用户信息
|
||||||
SysUser userInfo = userMapper.selectUserById(user.getUserId());
|
SysUser userInfo = userMapper.selectUserById(SecurityUtils.getUserId());
|
||||||
boolean isNewPassword = SecurityUtils.matchesPassword(decrypt, userInfo.getPassword());
|
boolean isNewPassword = SecurityUtils.matchesPassword(decrypt, userInfo.getPassword());
|
||||||
if (isNewPassword) {
|
if (isNewPassword) {
|
||||||
throw new ServiceException("新密码不能与旧密码相同!");
|
throw new ServiceException("新密码不能与旧密码相同!");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue