| | |
| | | if (config.data) { |
| | | // config.data = qs.stringify(config.data) |
| | | } |
| | | }else if(config.method == 'get' && config.data){ |
| | | config.params = config.data |
| | | } |
| | | const userStore = useUserStore() |
| | | const TOKEN = userStore.userInfo.token |
| | |
| | | config.headers['token'] = TOKEN |
| | | // config.params['token'] = TOKEN |
| | | } |
| | | config.params['language'] = getStorage('lang') || "en" |
| | | if(!config.params['not_language']) config.params['language'] = getStorage('lang') || "en" |
| | | |
| | | if (config.loading) { |
| | | showLoadingToast({ forbidClick: true, duration: 0 }) |
| | | isClose = true |
| | | } |
| | | |
| | | return config |
| | | }, error => { |
| | | return Promise.reject(error) |
| | |
| | | case 403: // 登录状态已过期,您可以继续留在该页面,或者重新登录 |
| | | userStore.userInfo = {} |
| | | store.state.user.userInfo = {} |
| | | showToast({ type: 'warning', message: i18n.global.t('请重新登录')}) |
| | | router.push({ |
| | | path: '/login' |
| | | }) |