From e28578e26aa46b082e835d657b7cc8d22c912047 Mon Sep 17 00:00:00 2001 From: 劉鈞霖 <benson@gmail.com> Date: 星期四, 02 十二月 2021 12:22:48 +0800 Subject: [PATCH] [ Update ] :修正登入 OTP 錯誤訊息 --- PAMapp/pages/login/index.vue | 7 ++++++- PAMapp/assets/ts/models/enum/otpErrorCode.ts | 12 ++++++++++++ 2 files changed, 18 insertions(+), 1 deletions(-) diff --git a/PAMapp/assets/ts/models/enum/otpErrorCode.ts b/PAMapp/assets/ts/models/enum/otpErrorCode.ts new file mode 100644 index 0000000..7357c48 --- /dev/null +++ b/PAMapp/assets/ts/models/enum/otpErrorCode.ts @@ -0,0 +1,12 @@ +export enum OtpErrorCode{ + + "01"="撽�Ⅳ�隤�", + "02"="���歇頞��", + "03"="�隤斗活�撌脤�頂蝯曹���������Ⅳ", + "04"="撖Ⅳ��頂蝯勗�隤�", + "05"="靽∠拳��炊", + "06"="�憓仃���", + "07"="��仃���", + "08"="����炊", + "09"="��甇夕ndexKey", +} diff --git a/PAMapp/pages/login/index.vue b/PAMapp/pages/login/index.vue index 796e1dc..a05f29c 100644 --- a/PAMapp/pages/login/index.vue +++ b/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; -- Gitblit v1.8.0