feat: 根据环境变量控制是否显示 /demos 开头的路由
CI/CD Pipeline / playwright (push) Successful in 4m11s
CI/CD Pipeline / build-and-deploy (push) Successful in 4m20s

This commit is contained in:
严浩 committed 2025-10-23 13:38:45 +08:00
1 parent a8b340403d
commit 4e43500084
2 files changed
+5

No files matched your search

@@ -20,6 +20,10 @@ function convertRoutesToMenuOptions(routes: Readonly<RouteRecordRaw[]>): MenuOpt
if (route.path.includes('*')) {
return false;
}
// 根据环境变量判断是否显示 /demos 开头的路由
if (route.path.startsWith('/demos') && import.meta.env.VITE_MENU_SHOW_DEMOS !== 'true') {
return false;
}
return true;
})
.sort((a, b) => a.path.localeCompare(b.path));