保誠-保戶業務員媒合平台
劉鈞霖
2021-12-02 e28578e26aa46b082e835d657b7cc8d22c912047
[ Update ] :修正登入 OTP 錯誤訊息
修改1個檔案
新增1個檔案
19 ■■■■■ 已變更過的檔案
PAMapp/assets/ts/models/enum/otpErrorCode.ts 12 ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/pages/login/index.vue 7 ●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/assets/ts/models/enum/otpErrorCode.ts
¤ñ¹ï·sÀÉ®×
@@ -0,0 +1,12 @@
export enum OtpErrorCode{
  "01"="驗證碼錯誤",
  "02"="時效已超過",
  "03"="錯誤次數已達系統上限,請重新發送驗證碼",
  "04"="密碼或系統別錯誤",
  "05"="信箱有誤",
  "06"="新增失敗",
  "07"="發送失敗",
  "08"="手機有誤",
  "09"="查無此indexKey",
}
PAMapp/pages/login/index.vue
@@ -344,6 +344,7 @@
import { Vue, Component, Ref } from 'vue-property-decorator';
import { LoginRequest, LoginVerify, loginVerify, OtpInfo, register, RegisterInfo, sendOtp } from '~/assets/ts/api/consultant';
import ErrorMessageBox from '~/assets/ts/errorService';
import { OtpErrorCode } from '~/assets/ts/models/enum/otpErrorCode';
import { Role } from '~/assets/ts/models/enum/Role';
const roleStorage = namespace('localStorage');
@@ -456,6 +457,9 @@
        this.storageOtpTime(type, otpInfo);
        this.startOtpSetting(type);
        this.startOtpCount(type);
      } else {
        const errorMsg = OtpErrorCode[otpInfo.failCode] ? OtpErrorCode[otpInfo.failCode]:'OTP系統錯誤';
        ErrorMessageBox(errorMsg);
      }
    });
  };
@@ -539,7 +543,8 @@
  private checkHttpErrorStatus(error:any):void{
    switch (error.response.status) {
        case 401:
          ErrorMessageBox('',error);
          const errorMsg = OtpErrorCode[error.response?.data?.detail] ? OtpErrorCode[error.response?.data?.detail]:'OTP系統錯誤';
          ErrorMessageBox(errorMsg);
          break;
        case 403:
          this.registerDialogVisible = true;