mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-10-14 20:01:28 +00:00
feat: add axiosCancel
This commit is contained in:
@@ -43,4 +43,16 @@ const router = createRouter({
|
||||
routes,
|
||||
});
|
||||
|
||||
(window as any).axiosCancel = [];
|
||||
|
||||
router.beforeEach((to, from, next) => {
|
||||
const token = window.localStorage.getItem("skywalking-authority");
|
||||
if ((window as any).axiosCancel.length !== 0) {
|
||||
for (const func of (window as any).axiosCancel) {
|
||||
setTimeout(func(), 0);
|
||||
}
|
||||
(window as any).axiosCancel = [];
|
||||
}
|
||||
next();
|
||||
});
|
||||
export default router;
|
||||
|
Reference in New Issue
Block a user