From 63a79c624065b379b774f7ad99e6e351af2e928b Mon Sep 17 00:00:00 2001 From: "2368302435@qq.com" <2368302435@qq.com> Date: Wed, 17 Apr 2024 03:11:13 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E7=AC=AC=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E8=8F=9C=E5=8D=95=E4=B8=BA=20Iframe=20=E6=97=B6?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E8=87=AA=E5=8A=A8=E8=B7=B3=E8=BD=AC=E7=9A=84?= =?UTF-8?q?=20BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/utils/router.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/utils/router.ts b/web/src/utils/router.ts index 720aa2a1..76f83733 100644 --- a/web/src/utils/router.ts +++ b/web/src/utils/router.ts @@ -43,7 +43,7 @@ export const routePush = async (to: RouteLocationRaw) => { /** * 获取第一个菜单 */ -export const getFirstRoute = (routes: RouteRecordRaw[], menuType = 'tab'): false | RouteRecordRaw => { +export const getFirstRoute = (routes: RouteRecordRaw[]): false | RouteRecordRaw => { const routerPaths: string[] = [] const routers = router.getRoutes() routers.forEach((item) => { @@ -51,7 +51,7 @@ export const getFirstRoute = (routes: RouteRecordRaw[], menuType = 'tab'): false }) let find: boolean | RouteRecordRaw = false for (const key in routes) { - if (routes[key].meta?.type == 'menu' && routes[key].meta?.menu_type == menuType && routerPaths.indexOf(routes[key].path) !== -1) { + if (routes[key].meta?.type == 'menu' && routerPaths.indexOf(routes[key].path) !== -1) { return routes[key] } else if (routes[key].children && routes[key].children?.length) { find = getFirstRoute(routes[key].children!)