bug: 去掉无用的入参
All checks were successful
Release / lint (push) Successful in 29s
Release / Release (push) Successful in 1m18s

This commit is contained in:
my_ong 2024-12-18 15:56:08 +08:00
parent f190f0ebea
commit 8e35143058

View File

@ -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