Commit 213f7250 by liuguorong93

更新

parent cf04275a
......@@ -48,7 +48,6 @@ axios.interceptors.request.use(
// //
// 这里的config包含每次请求的内容
let token = window.sessionStorage.getItem('token')
if (token) {
config.headers['blade-auth'] = `${token}` // 让每个请求携带token--['Authorization']为自定义key 请根据实际情况自行修改
......@@ -118,6 +117,17 @@ axios.interceptors.response.use(
}
);
instance.interceptors.request.use(
config => {
let token = window.sessionStorage.getItem('token')
if (token) {
config.headers['blade-auth'] = `${token}` // 让每个请求携带token--['Authorization']为自定义key 请根据实际情况自行修改
}
return config;
},
error => { }
)
instance.interceptors.response.use(
response => {
const status = response.data.code;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment