Fix: The requested interface timeout will cause the page to crash #4787 (#4788)

### What problem does this PR solve?

Fix: The requested interface timeout will cause the page to crash #4787

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
balibabu 2025-02-08 11:26:36 +08:00 committed by GitHub
parent b48c85dcf9
commit 5a51bdd824
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -68,7 +68,7 @@ const errorHandler = (error: {
}); });
} }
} }
return response; return response ?? { data: { code: 1999 } };
}; };
const request: RequestMethod = extend({ const request: RequestMethod = extend({
@ -98,7 +98,7 @@ request.interceptors.request.use((url: string, options: any) => {
}; };
}); });
request.interceptors.response.use(async (response: any, options) => { request.interceptors.response.use(async (response: Response, options) => {
if (response?.status === 413 || response?.status === 504) { if (response?.status === 413 || response?.status === 504) {
message.error(RetcodeMessage[response?.status as ResultCode]); message.error(RetcodeMessage[response?.status as ResultCode]);
} }