Commit 7ac83d46 authored by 唐峰's avatar 唐峰

修改验证码异常不报警

parent 9939b6e0
...@@ -6,6 +6,7 @@ import cn.quantgroup.xyqb.entity.User; ...@@ -6,6 +6,7 @@ import cn.quantgroup.xyqb.entity.User;
import cn.quantgroup.xyqb.exception.BizException; import cn.quantgroup.xyqb.exception.BizException;
import cn.quantgroup.xyqb.exception.BizExceptionEnum; import cn.quantgroup.xyqb.exception.BizExceptionEnum;
import cn.quantgroup.xyqb.exception.UserNotExistException; import cn.quantgroup.xyqb.exception.UserNotExistException;
import cn.quantgroup.xyqb.exception.VerificationCodeErrorException;
import cn.quantgroup.xyqb.model.AuthBean; import cn.quantgroup.xyqb.model.AuthBean;
import cn.quantgroup.xyqb.model.LoginBean; import cn.quantgroup.xyqb.model.LoginBean;
import cn.quantgroup.xyqb.model.LoginProperties; import cn.quantgroup.xyqb.model.LoginProperties;
...@@ -151,12 +152,12 @@ public class SMSLoginStrategy implements LoginStrategy { ...@@ -151,12 +152,12 @@ public class SMSLoginStrategy implements LoginStrategy {
if (!smsService.verifyPhoneAndCode(phoneNo, code)) { if (!smsService.verifyPhoneAndCode(phoneNo, code)) {
// 是否需要重新发送短信验证码 // 是否需要重新发送短信验证码
if (smsService.needResendCode(phoneNo, VERIFICATION_CODE_FINITE_COUNT_NEW, false)) { if (smsService.needResendCode(phoneNo, VERIFICATION_CODE_FINITE_COUNT_NEW, false)) {
throw new BizException(BizExceptionEnum.EXPIRE_SMS_CODE); throw new VerificationCodeErrorException(BizExceptionEnum.EXPIRE_SMS_CODE.getMsg());
} }
smsService.deleteOnlyCodeFromCache(phoneNo); smsService.deleteOnlyCodeFromCache(phoneNo);
log.info("验证码校验失败,phoneNo:{} , verificationCode:{}", phoneNo, code); log.info("验证码校验失败,phoneNo:{} , verificationCode:{}", phoneNo, code);
throw new BizException(BizExceptionEnum.ERROR_SMS_CODE); throw new VerificationCodeErrorException(BizExceptionEnum.ERROR_SMS_CODE.getMsg());
} else { } else {
smsService.deleteCodeFromCache(phoneNo); smsService.deleteCodeFromCache(phoneNo);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment