Merge pull request #399 from alleycharming/main

fix(projects): added responseType judgment. #396
This commit is contained in:
Soybean 2024-04-24 18:41:24 +08:00 committed by GitHub
commit a1e432f81e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -48,7 +48,9 @@ function createCommonRequest<ResponseData = any>(
instance.interceptors.response.use(
async response => {
if (opts.isBackendSuccess(response)) {
const responseType: ResponseType = (response.config?.responseType as ResponseType) || 'json';
if (responseType !== 'json' || opts.isBackendSuccess(response)) {
return Promise.resolve(response);
}