Skip to content

Commit

Permalink
fix(projects): added responseType judgment. #396
Browse files Browse the repository at this point in the history
  • Loading branch information
alleycharming committed Apr 24, 2024
1 parent 0d45b86 commit 82eabab
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/axios/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 82eabab

Please sign in to comment.