|
|
@ -12,9 +12,7 @@ const service = axios.create({
|
|
|
|
// request拦截器
|
|
|
|
// request拦截器
|
|
|
|
service.interceptors.request.use(
|
|
|
|
service.interceptors.request.use(
|
|
|
|
config => {
|
|
|
|
config => {
|
|
|
|
if (store.getters.token) {
|
|
|
|
config.headers['Authorization'] = (getToken() == null || getToken() == undefined) ? '': getToken()
|
|
|
|
config.headers['X-Token'] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return config
|
|
|
|
return config
|
|
|
|
},
|
|
|
|
},
|
|
|
|
error => {
|
|
|
|
error => {
|
|
|
|