diff --git a/packages/axios/src/index.ts b/packages/axios/src/index.ts index 64a75c3..7d4ac29 100644 --- a/packages/axios/src/index.ts +++ b/packages/axios/src/index.ts @@ -48,7 +48,7 @@ function createCommonRequest( instance.interceptors.response.use( async response => { - if (opts.isBackendSuccess(response)) { + if (opts.isBackendSuccess(response) || response.config?.responseType === "blob") { return Promise.resolve(response); } @@ -117,7 +117,6 @@ export function createRequest = await instance(config); const responseType = response.config?.responseType || 'json'; - if (responseType === 'json') { return opts.transformBackendResponse(response); } @@ -154,7 +153,6 @@ export function createFlatRequest = await instance(config); const responseType = response.config?.responseType || 'json'; - if (responseType === 'json') { const data = opts.transformBackendResponse(response);