This commit is contained in:
Xu Chang 2024-08-16 16:24:18 +08:00
parent 2e4955e032
commit 5408c68892
2 changed files with 2 additions and 2 deletions

View File

@ -124,7 +124,7 @@ function makeWebAllRouters(namespaceDir, projectDir, routerFileDir) {
let path2 = path;
if (params2[path]) {
// 如果有参数接在path后面
path2 += `/:${params2[path]}`;
path2 += path2 ? `/:${params2[path]}` : `:${params2[path]}`;
}
const properties = [
factory.createPropertyAssignment('path', factory.createStringLiteral(path2)),

View File

@ -188,7 +188,7 @@ function makeWebAllRouters(namespaceDir: string, projectDir: string, routerFileD
let path2 = path;
if (params2[path]) {
// 如果有参数接在path后面
path2 += `/:${params2[path]}`;
path2 += path2 ? `/:${params2[path]}` : `:${params2[path]}`;
}
const properties = [
factory.createPropertyAssignment(