leo
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
6 additions and
2 deletions
-
src/utils/http/axios/Axios.ts
|
|
|
@ -88,8 +88,8 @@ export class VAxios { |
|
|
|
|
|
|
|
// Request interceptor configuration processing
|
|
|
|
this.axiosInstance.interceptors.request.use((config: InternalAxiosRequestConfig) => { |
|
|
|
// If cancel repeat request is turned on, then cancel repeat request is prohibited
|
|
|
|
const { requestOptions } = this.options; |
|
|
|
// If cancel repeat request is turned on, then cancel repeat request is prohibited
|
|
|
|
const requestOptions = (config as unknown as any).requestOptions ?? this.options.requestOptions; |
|
|
|
const ignoreCancelToken = requestOptions?.ignoreCancelToken ?? true; |
|
|
|
|
|
|
|
!ignoreCancelToken && axiosCanceler.addPending(config); |
|
|
|
@ -202,6 +202,10 @@ export class VAxios { |
|
|
|
if (config.cancelToken) { |
|
|
|
conf.cancelToken = config.cancelToken; |
|
|
|
} |
|
|
|
|
|
|
|
if (config.signal) { |
|
|
|
conf.signal = config.signal; |
|
|
|
} |
|
|
|
|
|
|
|
const transform = this.getTransform(); |
|
|
|
|
|
|
|
|