mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-01-24 10:33:50 +08:00
fix(axios): get等方法配置ignoreCancelToken无效 (#3040)
This commit is contained in:
parent
4aaddef06f
commit
b43fe7adbc
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user