| | |
| | | import { AxiosRequestConfig, AxiosError, AxiosResponse } from 'axios'; |
| | | import ErrorMessageBox from '../errorService'; |
| | | import LocalStorage from '~/store/localStorage'; |
| | | import axios from 'axios'; |
| | | import _ from 'lodash'; |
| | | |
| | |
| | | window.$nuxt.$loading.finish(); |
| | | }; |
| | | |
| | | function showErrorMessageBox(error:AxiosError):void{ |
| | | function showErrorMessageBox(error:any):void{ |
| | | if(!_.includes(notRequireInterceptorErrorUrl,error.config.url)){ |
| | | ErrorMessageBox(); |
| | | switch (error.response.status) { |
| | | case 401: |
| | | ErrorMessageBox('登入逾時'); |
| | | window.$nuxt.$store.commit('localStorage/storageClear'); |
| | | break; |
| | | default: |
| | | ErrorMessageBox(); |
| | | break; |
| | | } |
| | | |
| | | } |
| | | }; |