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