mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-02 05:54:04 +00:00
feat: add axiosCancel
This commit is contained in:
parent
1b30216545
commit
b0f6194f0c
@ -43,4 +43,16 @@ const router = createRouter({
|
|||||||
routes,
|
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;
|
export default router;
|
||||||
|
8
src/shims-vue.d.ts
vendored
8
src/shims-vue.d.ts
vendored
@ -19,3 +19,11 @@ declare module "*.vue" {
|
|||||||
const Component: ReturnType<typeof defineComponent>;
|
const Component: ReturnType<typeof defineComponent>;
|
||||||
export default Component;
|
export default Component;
|
||||||
}
|
}
|
||||||
|
declare global {
|
||||||
|
namespace JSX {}
|
||||||
|
interface Window {
|
||||||
|
Promise: any;
|
||||||
|
moment: any;
|
||||||
|
axiosCancel: any;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -149,10 +149,10 @@ import {
|
|||||||
ElInput,
|
ElInput,
|
||||||
ElButton,
|
ElButton,
|
||||||
} from "element-plus";
|
} from "element-plus";
|
||||||
// import { useSelectorStore } from "@/store/modules/selectors";
|
import { useSelectorStore } from "@/store/modules/selectors";
|
||||||
import { EntityType, SelectOpt, Options } from "./data";
|
import { EntityType, SelectOpt, Options } from "./data";
|
||||||
|
|
||||||
// const selectorStore = useSelectorStore();
|
const selectorStore = useSelectorStore();
|
||||||
const props = {
|
const props = {
|
||||||
expandTrigger: "hover",
|
expandTrigger: "hover",
|
||||||
};
|
};
|
||||||
@ -173,24 +173,22 @@ const handleChange = (value: any) => {
|
|||||||
const onCreate = () => {
|
const onCreate = () => {
|
||||||
console.log(state);
|
console.log(state);
|
||||||
};
|
};
|
||||||
// selectorStore.fetchServices("general");
|
selectorStore.fetchServices("general");
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.new-dashboard {
|
.new-dashboard {
|
||||||
width: 600px;
|
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
.item {
|
.item {
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
}
|
}
|
||||||
.selectors {
|
.new-dashboard,
|
||||||
width: 600px;
|
.selectors,
|
||||||
}
|
|
||||||
.el-cascader-menu {
|
.el-cascader-menu {
|
||||||
width: 600px;
|
width: 600px;
|
||||||
}
|
}
|
||||||
.create {
|
.create {
|
||||||
width: 160px;
|
width: 600px;
|
||||||
}
|
}
|
||||||
.btn {
|
.btn {
|
||||||
margin-top: 40px;
|
margin-top: 40px;
|
||||||
|
Loading…
Reference in New Issue
Block a user