|
@@ -195,10 +195,6 @@ public class SysUserController {
|
|
}
|
|
}
|
|
TokenData tokenData = TokenData.takeFromRequest();
|
|
TokenData tokenData = TokenData.takeFromRequest();
|
|
SysUser user = sysUserService.getById(tokenData.getUserId());
|
|
SysUser user = sysUserService.getById(tokenData.getUserId());
|
|
- //String oldPass = URLDecoder.decode(sysUserDto.getOldPassword(), StandardCharsets.UTF_8.name());
|
|
|
|
- // NOTE: 第一次使用时,请务必阅读ApplicationConstant.PRIVATE_KEY的代码注释。
|
|
|
|
- // 执行RsaUtil工具类中的main函数,可以生成新的公钥和私钥。
|
|
|
|
- //oldPass = RsaUtil.encrypt(oldPass, ApplicationConstant.PUBLIC_KEY);
|
|
|
|
if (user == null) {
|
|
if (user == null) {
|
|
return ResMsg.error(CodeEnum.ACCOUNT_NO_PASSWORD_ERROR);
|
|
return ResMsg.error(CodeEnum.ACCOUNT_NO_PASSWORD_ERROR);
|
|
}
|
|
}
|
|
@@ -206,7 +202,6 @@ public class SysUserController {
|
|
return ResMsg.error(CodeEnum.OLD_PWD_ERROR);
|
|
return ResMsg.error(CodeEnum.OLD_PWD_ERROR);
|
|
}
|
|
}
|
|
String newPass = URLDecoder.decode(sysUserDto.getPassword(), StandardCharsets.UTF_8.name());
|
|
String newPass = URLDecoder.decode(sysUserDto.getPassword(), StandardCharsets.UTF_8.name());
|
|
- //newPass = RsaUtil.decrypt(newPass, ApplicationConstant.PRIVATE_KEY);
|
|
|
|
if (!sysUserService.changePassword(tokenData.getUserId(), newPass)) {
|
|
if (!sysUserService.changePassword(tokenData.getUserId(), newPass)) {
|
|
return ResMsg.error(CodeEnum.USER_NOT_FIND);
|
|
return ResMsg.error(CodeEnum.USER_NOT_FIND);
|
|
}
|
|
}
|