HalseySpicy / Hooks-Admin

🚀🚀🚀 Hooks Admin,基于 React18、React-Router V6、React-Hooks、Redux、TypeScript、Vite2、Ant-Design 开源的一套后台管理框架。
https://pro.spicyboy.cn
MIT License
1.65k stars 373 forks source link

cancelToken 在0.22.0 开始已经废弃,建议更改为AbortController的方式 #39

Open manongguai opened 11 months ago

manongguai commented 11 months ago

如题,并且路由跳转之前默认取消所有的请求,并不十分合理,比如menuList级别的request ,如果被提前终止会导致bug path: src/routers/utils/authRouter.tsx // * 在跳转路由之前,清除所有的请求 axiosCanceler.removeAllPending();

建议addPending时添加header判断

// axiosCanceler.addPending(config) // 修改为 config.headers!.notAllowCancel || axiosCanceler.addPending(config);

HalseySpicy commented 11 months ago

新版改了,还在重构中……

HalseySpicy commented 11 months ago

微信截图_20230712180228