From b8085c12e2f5542210c8a73a997e0b88d39e18b0 Mon Sep 17 00:00:00 2001 From: WXL <1785969728@qq.com> Date: 星期四, 20 三月 2025 16:45:56 +0800 Subject: [PATCH] 测试完成 --- src/store/modules/permission.js | 23 +++++++++++++++++++++++ 1 files changed, 23 insertions(+), 0 deletions(-) diff --git a/src/store/modules/permission.js b/src/store/modules/permission.js index 2287665..90e3782 100644 --- a/src/store/modules/permission.js +++ b/src/store/modules/permission.js @@ -4,6 +4,8 @@ import Layout from '@/layout/index' import ParentView from '@/components/ParentView' import InnerLink from '@/layout/components/InnerLink' +import store from "@/store"; + const permission = { state: { @@ -46,11 +48,32 @@ commit('SET_DEFAULT_ROUTES', sidebarRoutes) commit('SET_TOPBAR_ROUTES', sidebarRoutes) resolve(rewriteRoutes) + console.log(res.data,'璺敱鏁版嵁'); + const result = res.data.find(item => item.name == "Followvisit"); + Processrouting(result) + }) }) } } } +function Processrouting(result){ + const arrf=[]; + const arr=store.getters.Serviceauthority; + console.log(result,'result'); + console.log(arr,'arr'); + result.children.forEach(objA => { + arr.forEach(objB => { + if (objA.meta.title === objB.label) { + arrf.push(objB); + } + }); + }); + console.log(arrf,'arrf'); + store.commit('SET_Serviceauthority', arrf); + + +} // 閬嶅巻鍚庡彴浼犳潵鐨勮矾鐢卞瓧绗︿覆锛岃浆鎹负缁勪欢瀵硅薄 function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) { -- Gitblit v1.9.3