保誠-保戶業務員媒合平台
wayne
2022-03-01 13a5f7b7c1bd7733f62f2e76e15ce3660441df98
pamapi/src/main/java/com/pollex/pam/service/OtpUtilService.java
@@ -28,9 +28,6 @@
    @Autowired
    OtpTmpService otpTmpService;
    @Autowired
    LoginRecordService loginRecordService;
    @Transactional
    public void verifyOtp(VerifyOtpVM verifyOtpParam) {
        verifyOtp(verifyOtpParam.getAccount(), verifyOtpParam.getIndexKey(), verifyOtpParam.getOtpCode());
@@ -43,15 +40,13 @@
        } else {  // otp logon
            OtpResponseDTO otpResponseDTO = otpWebService.verifyOTP(indexKey, otpCode);
            if (otpResponseDTO.isSuccess()) {
                log.info("otp login success!");
                log.info("otp login success!, account = {}", account);
            }
            else {
                log.info("otp login fail... , account = {}, failReason = {}", account, otpResponseDTO.getFailReason());
                loginRecordService.saveOTPLoginFailRecord(account, otpResponseDTO.getFailReason());
                throw new OtpLoginFailException(otpResponseDTO.getFailReason());
                log.info("otp login fail... , account = {}, error code = {}, failReason = {}", account, otpResponseDTO.getFailCode(), otpResponseDTO.getFailReason());
                throw new OtpLoginFailException(otpResponseDTO.getFailCode());
            }
        }
        loginRecordService.saveOTPLoginSuccessRecord(account);
        setVerrifiedOtpTmp(account, indexKey);
    }