update
This commit is contained in:
14
src/App.vue
14
src/App.vue
@@ -1,17 +1,23 @@
|
||||
<script setup>
|
||||
import {onMounted} from "vue";
|
||||
import {useSystemStore} from "./pinia/SystemStore/index.js";
|
||||
import {useRoute} from "vue-router";
|
||||
import {toPath} from "./utils/index.js";
|
||||
|
||||
const SystemStore = useSystemStore();
|
||||
const route = useRoute();
|
||||
|
||||
onMounted(() => {
|
||||
const isRoot = SystemStore.isRoot;
|
||||
SystemStore.clearRouter().then(() => {
|
||||
SystemStore.setRouter(isRoot).then(() => {
|
||||
toPath(SystemStore.NOW_ROUTER, SystemStore.NOW_ROUTER_QUERY);
|
||||
if (window.location.href.indexOf('/manage-materials') < 0) {
|
||||
SystemStore.clearRouter().then(() => {
|
||||
SystemStore.setRouter(isRoot).then(() => {
|
||||
toPath(SystemStore.NOW_ROUTER, SystemStore.NOW_ROUTER_QUERY);
|
||||
});
|
||||
});
|
||||
});
|
||||
} else {
|
||||
toPath('/manage-materials', SystemStore.NOW_ROUTER_QUERY, true);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user