From 36274025d6a19de978bcaaae3f0ddb42f31ecd2f Mon Sep 17 00:00:00 2001 From: Zhong <58726932+cszhjh@users.noreply.github.com> Date: Thu, 18 Apr 2024 12:22:06 +0800 Subject: [PATCH] fix(util): resolve executing retry even when HTTP status code is 401 (#3756) --- src/utils/http/axios/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/utils/http/axios/index.ts b/src/utils/http/axios/index.ts index 7b7b8f28..9c3a86b2 100644 --- a/src/utils/http/axios/index.ts +++ b/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);