mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-01-24 18:40:22 +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
|
// Request interceptor configuration processing
|
||||||
this.axiosInstance.interceptors.request.use((config: InternalAxiosRequestConfig) => {
|
this.axiosInstance.interceptors.request.use((config: InternalAxiosRequestConfig) => {
|
||||||
// If cancel repeat request is turned on, then cancel repeat request is prohibited
|
// If cancel repeat request is turned on, then cancel repeat request is prohibited
|
||||||
const { requestOptions } = this.options;
|
const requestOptions = (config as unknown as any).requestOptions ?? this.options.requestOptions;
|
||||||
const ignoreCancelToken = requestOptions?.ignoreCancelToken ?? true;
|
const ignoreCancelToken = requestOptions?.ignoreCancelToken ?? true;
|
||||||
|
|
||||||
!ignoreCancelToken && axiosCanceler.addPending(config);
|
!ignoreCancelToken && axiosCanceler.addPending(config);
|
||||||
@ -202,6 +202,10 @@ export class VAxios {
|
|||||||
if (config.cancelToken) {
|
if (config.cancelToken) {
|
||||||
conf.cancelToken = config.cancelToken;
|
conf.cancelToken = config.cancelToken;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (config.signal) {
|
||||||
|
conf.signal = config.signal;
|
||||||
|
}
|
||||||
|
|
||||||
const transform = this.getTransform();
|
const transform = this.getTransform();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user