fixpath
This commit is contained in:
parent
2e4955e032
commit
5408c68892
|
|
@ -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)),
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Reference in New Issue