feat: add request retry (#1553)

This commit is contained in:
Captain
2022-03-19 00:07:34 +08:00
committed by GitHub
parent 78535bdd86
commit 136cbb1e3b
11 changed files with 111 additions and 3 deletions

7
types/axios.d.ts vendored
View File

@@ -23,8 +23,15 @@ export interface RequestOptions {
ignoreCancelToken?: boolean;
// Whether to send token in header
withToken?: boolean;
// 请求重试机制
retryRequest?: RetryRequest;
}
export interface RetryRequest {
isOpenRetry: boolean;
count: number;
waitTime: number;
}
export interface Result<T = any> {
code: number;
type: 'success' | 'error' | 'warning';