|
|
@@ -168,6 +168,9 @@ import useWebsoctStore from "@/store/modules/websocket";
|
|
|
import { toRaw } from "@vue/reactivity";
|
|
|
import iFrame from "@/components/iFrame/index.vue";
|
|
|
import { getInfo } from "@/api/login";
|
|
|
+import usePermissionStore from '@/store/modules/permission'
|
|
|
+const permissionStore = usePermissionStore()
|
|
|
+const sidebarRouters = computed(() => permissionStore.sidebarRouters);
|
|
|
const websoctStore = useWebsoctStore();
|
|
|
const router = useRouter(); //注册路由
|
|
|
const route = useRoute();
|
|
|
@@ -496,10 +499,15 @@ const hasRole = roles.some(role => {
|
|
|
return super_admin === role || permissionRoles.includes(role)
|
|
|
})
|
|
|
if (hasRole) {
|
|
|
+ // console.log('sidebarRouters',sidebarRouters.value);
|
|
|
+ const thisItem = sidebarRouters.value.find(item=>item.redirect == "noRedirect") //拿到系统管理的第一个菜单 判断依据:第一个redirect == "noRedirect"的路由
|
|
|
+ const path1 = thisItem.path //一级路由
|
|
|
+ const path2 = thisItem.children[0].path //二级路由
|
|
|
menuList.data.push(
|
|
|
{
|
|
|
label: "系统管理",
|
|
|
- path: "/biz/dirTemplate",
|
|
|
+ // path: "/biz/dirTemplate",
|
|
|
+ path: `${path1}/${path2}`,
|
|
|
imgs: system,
|
|
|
beimgs: issystem,
|
|
|
}
|