|
@@ -2,6 +2,7 @@ import axios from 'axios'
|
|
|
import router from '@/router'
|
|
import router from '@/router'
|
|
|
import store from '@/store'
|
|
import store from '@/store'
|
|
|
import { Message,Loading } from 'element-ui'
|
|
import { Message,Loading } from 'element-ui'
|
|
|
|
|
+import { getToken,removeToken } from '@/utils/auth'
|
|
|
import { tansParams,judgmentNetworkReturnAddress } from "@/utils/index";
|
|
import { tansParams,judgmentNetworkReturnAddress } from "@/utils/index";
|
|
|
|
|
|
|
|
//判定http或者https
|
|
//判定http或者https
|
|
@@ -29,7 +30,8 @@ service.interceptors.request.use(
|
|
|
config => {
|
|
config => {
|
|
|
// 弹层相关
|
|
// 弹层相关
|
|
|
loadingInstance = Loading.service(options)
|
|
loadingInstance = Loading.service(options)
|
|
|
- const token = localStorage.getItem('token')
|
|
|
|
|
|
|
+ // const token = localStorage.getItem('token')
|
|
|
|
|
+ const token = getToken();
|
|
|
if (token) {
|
|
if (token) {
|
|
|
config.headers['Authorization'] = token
|
|
config.headers['Authorization'] = token
|
|
|
}
|
|
}
|