浏览代码

fix(util): resolve executing retry even when HTTP status code is 401 (#3756)

Zhong 1 年之前
父节点
当前提交
36274025d6
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      src/utils/http/axios/index.ts

+ 1 - 0
src/utils/http/axios/index.ts

@@ -216,6 +216,7 @@ const transform: AxiosTransform = {
     const { isOpenRetry } = config.requestOptions.retryRequest;
     config.method?.toUpperCase() === RequestEnum.GET &&
       isOpenRetry &&
+      error?.response?.status !== 401 &&
       // @ts-ignore
       retryRequest.retry(axiosInstance, error);
     return Promise.reject(error);