| | |
| | | <script lang="ts"> |
| | | import { namespace } from 'nuxt-property-decorator'; |
| | | import { Vue, Component, Ref } from 'vue-property-decorator'; |
| | | import ErrorMessageBox from '~/shared/errorService'; |
| | | import { OtpErrorCode } from '~/shared/models/enum/otpErrorCode'; |
| | | import { Role } from '~/shared/models/enum/role'; |
| | | import { LoginRequest } from '~/shared/models/loginRequest.model'; |
| | |
| | | import { OtpInfo } from '~/shared/models/otpInfo.model'; |
| | | import { RegisterInfo } from '~/shared/models/registerInfo'; |
| | | import loginService from '~/shared/services/login.service'; |
| | | import messageBoxService from '~/shared/services/message-box.service'; |
| | | |
| | | const roleStorage = namespace('localStorage'); |
| | | |
| | |
| | | this.startOtpCount(type); |
| | | } else { |
| | | const errorMsg = OtpErrorCode[otpInfo.failCode] ? OtpErrorCode[otpInfo.failCode]:'OTP系統錯誤'; |
| | | ErrorMessageBox(errorMsg); |
| | | messageBoxService.showErrorMessage(errorMsg); |
| | | } |
| | | }); |
| | | }; |
| | |
| | | switch (error.response.status) { |
| | | case 401: |
| | | const errorMsg = OtpErrorCode[error.response?.data?.detail] ? OtpErrorCode[error.response?.data?.detail]:'OTP系統錯誤'; |
| | | ErrorMessageBox(errorMsg); |
| | | messageBoxService.showErrorMessage(errorMsg); |
| | | break; |
| | | case 403: |
| | | this.registerDialogVisible = true; |
| | |
| | | }, 1000); |
| | | break; |
| | | default: |
| | | ErrorMessageBox('',error); |
| | | messageBoxService.showErrorMessage('',error); |
| | | break; |
| | | } |
| | | } |