This commit is contained in:
2025-05-27 19:01:22 +08:00
parent c302c8ae50
commit 1371c6e701
11 changed files with 99 additions and 16 deletions

View File

@@ -1,10 +1,10 @@
import {createRouter, createWebHashHistory} from 'vue-router';
import {createRouter, createWebHistory} from 'vue-router';
import routes from "./routes.js";
import {useUserStore} from "../pinia/UserStore/index.js";
import {useSystemStore} from "../pinia/SystemStore/index.js";
const router = createRouter({
history: createWebHashHistory(),
history: createWebHistory(),
routes,
})
@@ -13,8 +13,10 @@ router.beforeEach((to, from, next) => {
const SystemStore = useSystemStore();
if (!isLogin && !to.path.includes('loginSYS')) {
next({ path: '/loginSYS' });
next({path: '/loginSYS'});
} else {
SystemStore.NOW_ROUTER = to.path;
Object.assign(SystemStore.NOW_ROUTER_QUERY, to.query);
next();
}
});