From 43c8bf0d0b373317980e500dd1d5b2bbd17ce882 Mon Sep 17 00:00:00 2001 From: mfish Date: Thu, 24 Nov 2022 06:45:28 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3get=E9=87=8D=E8=AF=95?= =?UTF-8?q?=E8=AF=B7=E6=B1=82=E8=BF=94=E5=9B=9E=E7=9A=84headers=E9=80=A0?= =?UTF-8?q?=E6=88=90=E6=97=A0=E6=B3=95=E6=88=90=E5=8A=9F=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=20(#2416)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(axiosSuccess): 操作成功后根据传入提示模式进行相应 * fix(axiosRetry): 解决get重试请求返回的headers造成无法成功请求的问题 --- src/utils/http/axios/axiosRetry.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/utils/http/axios/axiosRetry.ts b/src/utils/http/axios/axiosRetry.ts index d081b9676..a711e6511 100644 --- a/src/utils/http/axios/axiosRetry.ts +++ b/src/utils/http/axios/axiosRetry.ts @@ -16,6 +16,8 @@ export class AxiosRetry { return Promise.reject(error); } config.__retryCount += 1; + //请求返回后config的header不正确造成重试请求失败,删除返回headers采用默认headers + delete config.headers; return this.delay(waitTime).then(() => AxiosInstance(config)); }