通过
diff --git a/src/pages/merchant/pages/communication-center/index.vue b/src/pages/merchant/pages/communication-center/index.vue
index 217cad4..c1ee5ef 100644
--- a/src/pages/merchant/pages/communication-center/index.vue
+++ b/src/pages/merchant/pages/communication-center/index.vue
@@ -1,6 +1,6 @@
diff --git a/src/pinia/SystemStore/index.js b/src/pinia/SystemStore/index.js
index 7204dbe..d5385be 100644
--- a/src/pinia/SystemStore/index.js
+++ b/src/pinia/SystemStore/index.js
@@ -1,5 +1,5 @@
import {defineStore} from "pinia";
-import {ref} from "vue";
+import {reactive, ref} from "vue";
import router from "../../router/index.js";
import generateRouter from "../../router/generateRouter.js";
import Api from "../../api/index.js";
@@ -7,6 +7,8 @@ import Api from "../../api/index.js";
export const useSystemStore = defineStore("SystemStore", () => {
const isRoot = ref(false);
const RoutesTemp = ref([]);
+ const NOW_ROUTER = ref(null);
+ const NOW_ROUTER_QUERY = reactive({});
const installRoute = async () => {
const routes = generateRouter(RoutesTemp.value);
@@ -56,6 +58,8 @@ export const useSystemStore = defineStore("SystemStore", () => {
return {
isRoot,
RoutesTemp,
+ NOW_ROUTER,
+ NOW_ROUTER_QUERY,
setRouter,
installRoute,
clearRouter,
@@ -67,6 +71,6 @@ export const useSystemStore = defineStore("SystemStore", () => {
afterHydrate: (val) => {
val.store.installRoute && val.store.installRoute();
},
- pick: ['RoutesTemp']
+ pick: ['RoutesTemp', 'NOW_ROUTER', 'NOW_ROUTER_QUERY'],
}
});
diff --git a/src/router/index.js b/src/router/index.js
index d00df55..f24facb 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -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();
}
});
diff --git a/src/router/routes.js b/src/router/routes.js
index 2aedbb7..bbf1bb8 100644
--- a/src/router/routes.js
+++ b/src/router/routes.js
@@ -1,5 +1,3 @@
-import routesMap from "./routes-map.js";
-
const routes = [
{
path: '/',