提交 95444a6e 编写于 作者: Mr.奇淼('s avatar Mr.奇淼(

头部信息增加用户id

上级 11e6311c
......@@ -21,21 +21,23 @@ const showLoading = () => {
}
const closeLoading = () => {
acitveAxios--
if (acitveAxios <= 0) {
clearTimeout(timer)
loadingInstance && loadingInstance.close()
}
acitveAxios--
if (acitveAxios <= 0) {
clearTimeout(timer)
loadingInstance && loadingInstance.close()
}
//http request 拦截器
}
//http request 拦截器
service.interceptors.request.use(
config => {
showLoading()
const token = store.getters['user/token']
const user = store.getters['user/userInfo']
config.data = JSON.stringify(config.data);
config.headers = {
'Content-Type': 'application/json',
'x-token': token
'x-token': token,
'x-user-id':user.ID
}
return config;
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册