Browse Source

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

Zhong 1 năm trước cách đây
mục cha
commit
36274025d6
1 tập tin đã thay đổi với 1 bổ sung0 xóa
  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);