diff --git a/src/layout/components/SiderBar/Components/GlobalSeach/index.tsx b/src/layout/components/SiderBar/Components/GlobalSeach/index.tsx index 69b33eb4..a0043692 100644 --- a/src/layout/components/SiderBar/Components/GlobalSeach/index.tsx +++ b/src/layout/components/SiderBar/Components/GlobalSeach/index.tsx @@ -97,7 +97,7 @@ const GlobalSeach = defineComponent({ const filterArr = (options: AppMenuOption[]) => { options.forEach((curr) => { - if (curr.children?.length) { + if (curr.children?.length && validMenuItemShow(curr)) { filterArr(curr.children) } diff --git a/src/router/helper/routerCopilot.ts b/src/router/helper/routerCopilot.ts index f19c0ee1..4caec228 100644 --- a/src/router/helper/routerCopilot.ts +++ b/src/router/helper/routerCopilot.ts @@ -72,11 +72,11 @@ export const validMenuItemShow = (option: AppMenuOption) => { return false } - if (!sameLevel && !hidden) { - return true + if (hidden) { + return false } - return !hidden ? true : false + return true } /**