Commit ce030d2d1db7293a973777076c678d1d04ddea82
Committed by
GitHub
1 parent
43c8bf0d
axiosRetry参数首字母小写 (#2419)
* feat(axiosSuccess): 操作成功后根据传入提示模式进行相应 * fix(axiosRetry): 解决get重试请求返回的headers造成无法成功请求的问题 * fix(axiosRetry): 参数首字母小写
Showing
1 changed file
with
2 additions
and
2 deletions
src/utils/http/axios/axiosRetry.ts
@@ -7,7 +7,7 @@ export class AxiosRetry { | @@ -7,7 +7,7 @@ export class AxiosRetry { | ||
7 | /** | 7 | /** |
8 | * 重试 | 8 | * 重试 |
9 | */ | 9 | */ |
10 | - retry(AxiosInstance: AxiosInstance, error: AxiosError) { | 10 | + retry(axiosInstance: AxiosInstance, error: AxiosError) { |
11 | // @ts-ignore | 11 | // @ts-ignore |
12 | const { config } = error.response; | 12 | const { config } = error.response; |
13 | const { waitTime, count } = config?.requestOptions?.retryRequest; | 13 | const { waitTime, count } = config?.requestOptions?.retryRequest; |
@@ -18,7 +18,7 @@ export class AxiosRetry { | @@ -18,7 +18,7 @@ export class AxiosRetry { | ||
18 | config.__retryCount += 1; | 18 | config.__retryCount += 1; |
19 | //请求返回后config的header不正确造成重试请求失败,删除返回headers采用默认headers | 19 | //请求返回后config的header不正确造成重试请求失败,删除返回headers采用默认headers |
20 | delete config.headers; | 20 | delete config.headers; |
21 | - return this.delay(waitTime).then(() => AxiosInstance(config)); | 21 | + return this.delay(waitTime).then(() => axiosInstance(config)); |
22 | } | 22 | } |
23 | 23 | ||
24 | /** | 24 | /** |