Raod 3 years ago
parent e5cb74a540
commit ecfa4a310b

@ -10,7 +10,6 @@ const service = axios.create({
timeout: 60000,
headers: {
'Content-Type': 'application/json',
'Authorization': getItem('token')
}
})

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

Loading…
Cancel
Save