Commit 2232eac8403486ec08f3a9292de3487c055bfa14

Authored by 云中非
1 parent 68686dba

refactor: 密码找回

1、验证码错误提示内容调整
... ... @@ -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
... ...