update
This commit is contained in:
parent
222242dccc
commit
cda848588b
|
|
@ -14,7 +14,7 @@ class HttpRequest {
|
||||||
}
|
}
|
||||||
return config
|
return config
|
||||||
}
|
}
|
||||||
distroy (url) {
|
destroy (url) {
|
||||||
delete this.queue[url]
|
delete this.queue[url]
|
||||||
if (!Object.keys(this.queue).length) {
|
if (!Object.keys(this.queue).length) {
|
||||||
// Spin.hide()
|
// Spin.hide()
|
||||||
|
|
@ -34,11 +34,11 @@ class HttpRequest {
|
||||||
})
|
})
|
||||||
// 响应拦截
|
// 响应拦截
|
||||||
instance.interceptors.response.use(res => {
|
instance.interceptors.response.use(res => {
|
||||||
this.distroy(url)
|
this.destroy(url)
|
||||||
const { data, status } = res
|
const { data, status } = res
|
||||||
return { data, status }
|
return { data, status }
|
||||||
}, error => {
|
}, error => {
|
||||||
this.distroy(url)
|
this.destroy(url)
|
||||||
return Promise.reject(error)
|
return Promise.reject(error)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue