From 8e351430589612c784516e62100c006ad4b3db12 Mon Sep 17 00:00:00 2001 From: my_ong <429426262@qq.com> Date: Wed, 18 Dec 2024 15:56:08 +0800 Subject: [PATCH] =?UTF-8?q?bug:=20=E5=8E=BB=E6=8E=89=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E7=9A=84=E5=85=A5=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/router/index.ts b/src/router/index.ts index 06528c3..5288ce5 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -201,7 +201,8 @@ const filterRoutesByPermission = (routes: RouteRecordRaw[], permissions: string[ const whiteList = ['Index', 'Admin', 'Message', 'LoginPage', 'Login'] // 路由守卫 -router.beforeEach(async (to, from, next) => { +router.beforeEach(async (to, _, next) => { + // 使用 _ 来忽略 from 参数 if (to.name && whiteList.includes(to.name as string)) { next() return