Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
11e2663fb3
|
|
@ -156,11 +156,11 @@ public class UserController {
|
|||
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||
UserDto user = userService.findByName(currentUsername);
|
||||
String oldPass = RsaUtils.decryptByPrivateKey(RsaProperties.privateKey, passVo.getOldPass());
|
||||
String newPass = RsaUtils.decryptByPrivateKey(RsaProperties.privateKey, passVo.getNewPass());
|
||||
if (!passwordEncoder.matches(oldPass, user.getPassword())) {
|
||||
throw new BadRequestException("修改失败,旧密码错误");
|
||||
}
|
||||
if (passwordEncoder.matches(newPass, user.getPassword())) {
|
||||
System.out.println(oldPass);
|
||||
if (passwordEncoder.matches(passVo.getNewPass(), user.getPassword())) {
|
||||
throw new BadRequestException("新密码不能与旧密码相同");
|
||||
}
|
||||
String encPass = MD5Utils.encrypt( passVo.getNewPass());
|
||||
|
|
@ -170,7 +170,7 @@ public class UserController {
|
|||
}else {
|
||||
shopStaffRepository.updatePass(currentUsername,encPass,System.currentTimeMillis());
|
||||
}
|
||||
userService.updatePass(user.getUsername(),passwordEncoder.encode(newPass));
|
||||
userService.updatePass(user.getUsername(),passwordEncoder.encode(passVo.getNewPass()));
|
||||
onlineUserService.logout(tokenProvider.getToken(request));
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue