Commit 3edb5da8 authored by yyh's avatar yyh

?操作符

parent 34a03c69
......@@ -118,10 +118,10 @@ instance.interceptors.response.use(
const diff = 200 - (Date.now() - time);
if (diff) {
setTimeout(() => {
loading && loading.clear();
loading?.clear();
}, diff);
} else {
loading && loading.clear();
loading?.clear();
}
if ( res.status === 200) {
if (res.data.code === 200) {
......@@ -139,6 +139,7 @@ instance.interceptors.response.use(
// 请求失败
(error: any) => {
const { response } = error;
loading?.clear();
if (response) {
// 请求已发出,但是不在2xx的范围
errorHandle(response.status, response.data.message);
......
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