| | |
| | | import router from '@/router/' |
| | | import { serialize } from '@/utils/util' |
| | | import { getToken, removeRefreshToken, removeToken } from '@/utils/auth' |
| | | import { validatenull } from '@/utils/validate' |
| | | import { isURL, validatenull } from '@/utils/validate' |
| | | import website from '@/config/website' |
| | | import NProgress from 'nprogress' // progress bar |
| | | import 'nprogress/nprogress.css' // progress bar style |
| | | import crypto from '@/utils/crypto' |
| | | import { getStore } from '@/utils/store' |
| | | import { showToast } from 'vant' |
| | | import { baseUrl } from '@/config/env' |
| | | |
| | | let { VITE_APP_ENV,VITE_APP_XT_URL,VITE_APP_API } = import.meta.env |
| | | // 全局未授权错误提示状态,只提示一次 |
| | |
| | | // } else { |
| | | // config.url = VITE_APP_XT_URL + config.url |
| | | // } |
| | | |
| | | //地址为已经配置状态则不添加前缀 |
| | | if (!isURL(config.url) && !config.url.startsWith(baseUrl)) { |
| | | config.url = baseUrl + config.url |
| | | } |
| | | |
| | | config.headers['areaCode'] = store.state.user.selectedAreaCode |
| | | //安全请求header |
| | | config.headers['Blade-Requested-With'] = 'BladeHttpRequest' |