| | |
| | | service.interceptors.response.use( |
| | | (response: AxiosResponse) => { |
| | | loadingFinish(); |
| | | return response.data; |
| | | return response; |
| | | }, |
| | | (error: AxiosError) => { |
| | | loadingFinish(); |
| | |
| | | if (!_.includes(notRequireInterceptorErrorUrl, error.config.url)) { |
| | | switch (error.response.status) { |
| | | case 401: |
| | | Promise.all([ErrorMessageBox('登入逾時'), window.$nuxt.$store.dispatch('localStorage/actionStorageClear')]).then(() => { |
| | | Promise.all([ErrorMessageBox('登入逾時'),window.$nuxt.$store.dispatch('localStorage.service/clearStorage')]).then(()=>{ |
| | | _.isEqual(window.$nuxt.$route.name, 'index') ? location.reload() : window.$nuxt.$router.push('/'); |
| | | }); |
| | | break; |