Showing
2 changed files
with
3 additions
and
5 deletions
... | ... | @@ -43,6 +43,7 @@ public enum ErrorMessage { |
43 | 43 | CONVERT_JS_IS_ALONE(400024,"转换脚本只能启用一个"), |
44 | 44 | PHONE_OR_EMAIL_HAS_REGISTER(400025,"手机或邮箱已被使用"), |
45 | 45 | CONTACT_ALREADY_ASSOCIATED(400026,"当前联系人已被设备配置关联"), |
46 | + MSG_CODE_NOT_MATCHED(400027,"验证码不正确"), | |
46 | 47 | HAVE_NO_PERMISSION(500002,"没有修改权限"); |
47 | 48 | private final int code; |
48 | 49 | private String message; | ... | ... |
... | ... | @@ -459,13 +459,10 @@ public class YtUserServiceImpl extends AbstractBaseService<UserMapper, User> |
459 | 459 | }) |
460 | 460 | .orElse(false); |
461 | 461 | if (!correct) { |
462 | - throw new BadCredentialsException("验证码不正确"); | |
462 | + throw new YtDataValidationException(ErrorMessage.MSG_CODE_NOT_MATCHED.getMessage()); | |
463 | 463 | } |
464 | 464 | String pwd = forget.getPassword(); |
465 | - if (StringUtils.isEmpty(pwd) | |
466 | -// || StringUtils.isEmpty(forget.getResetPassword()) | |
467 | -// || !pwd.equals(forget.getResetPassword()) | |
468 | - ) { | |
465 | + if (StringUtils.isEmpty(pwd)) { | |
469 | 466 | throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
470 | 467 | } |
471 | 468 | ... | ... |