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 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) 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