建立生成器功能
Some checks failed
Node CI / build (14.x, macOS-latest) (push) Has been cancelled
Node CI / build (14.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (14.x, windows-latest) (push) Has been cancelled
Node CI / build (16.x, macOS-latest) (push) Has been cancelled
Node CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (16.x, windows-latest) (push) Has been cancelled
coverage CI / build (push) Has been cancelled
Node pnpm CI / build (16.x, macOS-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, windows-latest) (push) Has been cancelled

This commit is contained in:
francis-fh
2026-07-23 12:30:28 +08:00
parent cd92dd4628
commit cd9a5b4c35
6 changed files with 257 additions and 49 deletions

View File

@@ -44,14 +44,16 @@ function patchRouteItems(route: any, menu: any, parentPath: string) {
if (path.length > 0) {
path += '/';
}
if (name !== 'index') {
path += name.at(0)?.toUpperCase() + name.substr(1);
// 不区分大小写判断 "index",避免服务端返回 "Index"大写I时在 Linux 上找不到模块
// 统一输出小写 "index" 以匹配 webpack 模块注册路径
if (name.toLowerCase() === 'index') {
path += 'index';
} else {
path += name;
path += name.at(0)?.toUpperCase() + name.substr(1);
}
})
});
if (!path.endsWith('.tsx')) {
path += '.tsx'
path += '.tsx';
}
if (route.routes === undefined) {
route.routes = [];