|
@@ -6,11 +6,12 @@ import { getToken } from '@/utils/auth'
|
|
|
import { envDomain } from '@/utils/.env.domain'
|
|
|
|
|
|
// axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8'
|
|
|
-
|
|
|
-axios.defaults.baseURL = process.env.VUE_APP_ISPROXY * 1 ? '' : envDomain.API_AUTH
|
|
|
+// axios.defaults.withCredentials = false
|
|
|
axios.defaults.timeout = 20000
|
|
|
|
|
|
axios.interceptors.request.use(config => {
|
|
|
+ // 设置请求域名
|
|
|
+ config.baseURL = process.env.VUE_APP_ISPROXY * 1 ? '' : /\/api\/auth/.test(config.url) ? envDomain.API_AUTH : envDomain.API_DOMAIN
|
|
|
if (getToken()) {
|
|
|
config.headers['token'] = getToken()
|
|
|
}
|