fetch请求,取消请求

249 阅读1分钟
const aborter = new AbortController()

const config = {} as AxiosRequestConfig

// 给请求体设置标记
config.signal = aborter.signal

// 取消请求
aborter..abort()