| | |
| | | import { userKey, type DataInfo } from "@/utils/auth"; |
| | | import { type menuType, routerArrays } from "@/layout/types"; |
| | | import { useMultiTagsStoreHook } from "@/store/modules/multiTags"; |
| | | import { useUserStoreHook } from "@/store/modules/user"; |
| | | import { usePermissionStoreHook } from "@/store/modules/permission"; |
| | | const IFrame = () => import("@/layout/frame.vue"); |
| | | // https://cn.vitejs.dev/guide/features.html#glob-import |
| | |
| | | /** 从localStorage里取出当前登录用户的角色roles,过滤无权限的菜单 */ |
| | | function filterNoPermissionTree(data: RouteComponent[]) { |
| | | const currentRoles = |
| | | storageLocal().getItem<DataInfo<number>>(userKey)?.roles ?? []; |
| | | storageLocal().getItem<DataInfo<number>>(userKey)?.exRoles ?? []; |
| | | const newTree = cloneDeep(data).filter((v: any) => |
| | | isOneOfArray(v.meta?.roles, currentRoles) |
| | | ); |
| | |
| | | usePermissionStoreHook().wholeMenus[0]?.children[0] |
| | | ); |
| | | tag && useMultiTagsStoreHook().handleTags("push", topMenu); |
| | | console.log(topMenu, "topMenu"); |
| | | // console.log(topMenu, "topMenu"); |
| | | |
| | | return topMenu; |
| | | } |