From ce030d2d1db7293a973777076c678d1d04ddea82 Mon Sep 17 00:00:00 2001 From: mfish Date: Thu, 24 Nov 2022 18:16:34 +0800 Subject: [PATCH] =?UTF-8?q?axiosRetry=E5=8F=82=E6=95=B0=E9=A6=96=E5=AD=97?= =?UTF-8?q?=E6=AF=8D=E5=B0=8F=E5=86=99=20(#2419)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(axiosSuccess): 操作成功后根据传入提示模式进行相应 * fix(axiosRetry): 解决get重试请求返回的headers造成无法成功请求的问题 * fix(axiosRetry): 参数首字母小写 --- src/utils/http/axios/axiosRetry.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/http/axios/axiosRetry.ts b/src/utils/http/axios/axiosRetry.ts index a711e651..81fc9cf9 100644 --- a/src/utils/http/axios/axiosRetry.ts +++ b/src/utils/http/axios/axiosRetry.ts @@ -7,7 +7,7 @@ export class AxiosRetry { /** * 重试 */ - retry(AxiosInstance: AxiosInstance, error: AxiosError) { + retry(axiosInstance: AxiosInstance, error: AxiosError) { // @ts-ignore const { config } = error.response; const { waitTime, count } = config?.requestOptions?.retryRequest; @@ -18,7 +18,7 @@ export class AxiosRetry { config.__retryCount += 1; //请求返回后config的header不正确造成重试请求失败,删除返回headers采用默认headers delete config.headers; - return this.delay(waitTime).then(() => AxiosInstance(config)); + return this.delay(waitTime).then(() => axiosInstance(config)); } /**