|
@@ -192,30 +192,17 @@ public class TmUserServiceImpl extends ServiceImpl<ITmUserMapper, TmUser> implem
|
|
@Override
|
|
@Override
|
|
public void changePassword(UserAddRequest param) {
|
|
public void changePassword(UserAddRequest param) {
|
|
if(StringUtils.isBlank(param.getUserName()) || StringUtils.isBlank(param.getPassword())
|
|
if(StringUtils.isBlank(param.getUserName()) || StringUtils.isBlank(param.getPassword())
|
|
- || StringUtils.isBlank(param.getConfirmPwd()) || StringUtils.isBlank(param.getOldPassword())){
|
|
|
|
|
|
+ || StringUtils.isBlank(param.getConfirmPwd()) || StringUtils.isBlank(param.getCode())){
|
|
throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|
|
throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|
|
}
|
|
}
|
|
TmUser tmUser = this.getByUserName(param.getUserName());
|
|
TmUser tmUser = this.getByUserName(param.getUserName());
|
|
if(tmUser == null){
|
|
if(tmUser == null){
|
|
throw new BusinessException(ResultCode.USER_NOT_EXIST);
|
|
throw new BusinessException(ResultCode.USER_NOT_EXIST);
|
|
}
|
|
}
|
|
- User user = userService.getByUserName(param.getUserName());
|
|
|
|
- if(user == null){
|
|
|
|
- throw new BusinessException(ResultCode.USER_NOT_EXIST);
|
|
|
|
- }
|
|
|
|
if (!StringUtils.equals(param.getPassword(), param.getConfirmPwd())) {
|
|
if (!StringUtils.equals(param.getPassword(), param.getConfirmPwd())) {
|
|
throw new BusinessException(ResultCode.USER_PASSWORD_ERROR);
|
|
throw new BusinessException(ResultCode.USER_PASSWORD_ERROR);
|
|
}
|
|
}
|
|
- if(StringUtils.isBlank(param.getClear()) || !param.getClear().equals("YES")) {
|
|
|
|
- String password = Base64Converter.decode(Base64Converter.subText(param.getOldPassword()));
|
|
|
|
- String passwordCode = SecurityUtil.MD5(password);
|
|
|
|
- if(!user.getPassword().equals(passwordCode)){
|
|
|
|
- throw new BusinessException(ResultCode.PROJECT_PASSWORD_ERROR);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- FdkkLoginRequest request = new FdkkLoginRequest(param.getUserName(),param.getPassword(),param.getConfirmPwd());
|
|
|
|
- request.setClear(param.getClear());
|
|
|
|
|
|
+ FdkkLoginRequest request = new FdkkLoginRequest(param.getUserName(),param.getPassword(),param.getConfirmPwd(),param.getCode());
|
|
FdkkResponse fdkkResponse = fdKKClient.fdkkChangePassword(request);
|
|
FdkkResponse fdkkResponse = fdKKClient.fdkkChangePassword(request);
|
|
if(fdkkResponse.getCode() != 0){
|
|
if(fdkkResponse.getCode() != 0){
|
|
throw new BusinessException(fdkkResponse.getCode(),fdkkResponse.getMsg());
|
|
throw new BusinessException(fdkkResponse.getCode(),fdkkResponse.getMsg());
|