diff --git a/src/routers/modules/dynamicRouter.ts b/src/routers/modules/dynamicRouter.ts index 5875a54..1150b18 100644 --- a/src/routers/modules/dynamicRouter.ts +++ b/src/routers/modules/dynamicRouter.ts @@ -36,7 +36,7 @@ export const initDynamicRouter = async (params?: any) => { } // 3.添加动态路由 - authStore.flatMenuListGet.forEach((item: any) => { + authStore.flatMenuListGet.forEach((item: any, index: any) => { item.children && delete item.children; if (item.component && isType(item.component) == "string") { item.component = modules["/src/views" + item.component + ".vue"]; @@ -55,11 +55,17 @@ export const initDynamicRouter = async (params?: any) => { router.addRoute("layout", item); if (globalStore.path) { // console.log("exec"); - router.push(globalStore.path); - + if (globalStore.path == item.path) { + router.push(globalStore.path); + } else { + if (item.path != "/" && index == 1) { + router.push(item.path); + } + } // globalStore.setPath(null); } else { // 其他处理 + globalStore.setPath(null); } } }); diff --git a/src/views/goverment/huizhou/largeScreen/largeScreenTwo/components/RigthBottLeftView.vue b/src/views/goverment/huizhou/largeScreen/largeScreenTwo/components/RigthBottLeftView.vue index 6b1a374..e6b0cc3 100644 --- a/src/views/goverment/huizhou/largeScreen/largeScreenTwo/components/RigthBottLeftView.vue +++ b/src/views/goverment/huizhou/largeScreen/largeScreenTwo/components/RigthBottLeftView.vue @@ -96,27 +96,27 @@