Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

调用cancel无法中断axios请求,请问如何才能停止axios请求 #2371

Closed
xian107 opened this issue Nov 15, 2023 · 2 comments
Closed

Comments

@xian107
Copy link

xian107 commented Nov 15, 2023

当接口请求还没返回的时候,又执行了一次页面搜索,怎么取消先前的请求

@hchlq
Copy link
Collaborator

hchlq commented Nov 17, 2023

cancel 是无法中断 axios 请求的,他只能中断 promise 的请求。

useRequest 也只负责管理 promise 的请求,如果需要中断 axios 的请求,需要业务自己处理

@BoyXuanzai
Copy link

想问问楼主最后的解决方案是什么

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants