📜  axios 取消请求 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:41.592000             🧑  作者: Mango

代码示例2
const cancelTokenSource = axios.CancelToken.source();

axios.get('/user/12345', {
  cancelToken: cancelTokenSource.token
});

// Cancel request
cancelTokenSource.cancel();