Commit e0438335 by liang ce

setSpinning

parent 3d68bb63
...@@ -28,17 +28,13 @@ axios.interceptors.request.use((config) => { ...@@ -28,17 +28,13 @@ axios.interceptors.request.use((config) => {
}) })
// 配置请求返回的拦截器, // 配置请求返回的拦截器,
axios.interceptors.response.use(res => { axios.interceptors.response.use(res => {
// if (res.data.resultCode === 0) {
// return Promise.resolve(res)
// } else {
// return Promise.reject()
// }
if (res.data.code === 0 || res.data.resultCode === 0) { if (res.data.code === 0 || res.data.resultCode === 0) {
store.dispatch('setSpinning', false) store.dispatch('setSpinning', false)
return Promise.resolve(res) return Promise.resolve(res)
} else if (res.data.code === 40003 || res.data.resultCode === 40003) { } else if (res.data.code === 40003 || res.data.resultCode === 40003) {
store.dispatch('setSpinning', false)
message.error('权限不足') message.error('权限不足')
return Promise.reject('1') return Promise.reject()
} }
}, err => { }, err => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
......
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