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

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);
}