fix(axios): get等方法配置ignoreCancelToken无效
parent
6034ffecf2
commit
f712bbf370
|
@ -22,5 +22,5 @@ export const buttonProps = {
|
|||
* @default: 14
|
||||
*/
|
||||
iconSize: { type: Number, default: 14 },
|
||||
onClick: { type: Function as PropType<(...args) => any>, default: null },
|
||||
onClick: { type: [Function, Array] as PropType<(() => any) | (() => any)[]>, default: null },
|
||||
}
|
||||
|
|
|
@ -90,7 +90,7 @@ export class VAxios {
|
|||
|
||||
// 请求拦截器配置处理
|
||||
this.axiosInstance.interceptors.request.use((config: InternalAxiosRequestConfig) => {
|
||||
const { requestOptions } = this.options
|
||||
const requestOptions = (config as unknown as any).requestOptions ?? this.options.requestOptions
|
||||
const ignoreCancelToken = requestOptions?.ignoreCancelToken ?? true
|
||||
|
||||
!ignoreCancelToken && axiosCanceler.addPending(config)
|
||||
|
@ -331,6 +331,9 @@ export class VAxios {
|
|||
if (config.cancelToken)
|
||||
conf.cancelToken = config.cancelToken
|
||||
|
||||
if (config.signal)
|
||||
conf.signal = config.signal
|
||||
|
||||
const transform = this.getTransform()
|
||||
|
||||
const { requestOptions } = this.options
|
||||
|
|
Loading…
Reference in New Issue