|
@@ -38,10 +38,8 @@ const err = (error) => {
|
|
|
// request interceptor
|
|
|
service.interceptors.request.use(config => {
|
|
|
const token = store.getters.token
|
|
|
- const changeOrg = store.getters.changeOrg
|
|
|
if (token) {
|
|
|
config.headers['access-token'] = token // 让每个请求携带自定义 token 请根据实际情况自行修改
|
|
|
- config.headers['access-org'] = changeOrg // 当前要切换的账号 sn
|
|
|
}
|
|
|
return config
|
|
|
}, err)
|
|
@@ -64,13 +62,20 @@ service.interceptors.response.use((response) => {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
- if ((response.data.status == '401' || response.data.status == '900' || response.data.status == '500') && window.location.pathname != '/user/login') {
|
|
|
+ if ((response.data.status == '401' || response.data.status == '500') && window.location.pathname != '/user/login') {
|
|
|
notification.destroy()
|
|
|
notification.error({
|
|
|
message: '提示',
|
|
|
description: response.data.message
|
|
|
})
|
|
|
}
|
|
|
+ if (response.data.status == '900' && window.location.pathname != '/user/login') {
|
|
|
+ notification.destroy()
|
|
|
+ notification.error({
|
|
|
+ message: response.data.message,
|
|
|
+ description: response.data.code
|
|
|
+ })
|
|
|
+ }
|
|
|
return response.data
|
|
|
}, err)
|
|
|
|