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

调整axios封装

上级 2863f18e
......@@ -36,11 +36,11 @@ service.interceptors.request.use(
}
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-user-id': user.ID
'x-user-id': user.ID,
...config.headers
}
return config
},
......@@ -70,7 +70,7 @@ service.interceptors.response.use(
} else {
ElMessage({
showClose: true,
message: response.data.msg||decodeURI(response.headers.msg),
message: response.data.msg || decodeURI(response.headers.msg),
type: 'error'
})
if (response.data.data && response.data.data.reload) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册