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

This commit is contained in:
Zhong 2024-04-18 12:22:06 +08:00 committed by GitHub
parent 04d4c5cd66
commit 36274025d6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 0 deletions

View File

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