Raod 3 years ago
parent e5cb74a540
commit ecfa4a310b

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

@ -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 => {

Loading…
Cancel
Save