[fix] adminRoot replace bug

This commit is contained in:
Max 2022-09-29 13:04:37 +08:00
parent e522ce8cd5
commit 4911b3214b
4 changed files with 5605 additions and 67 deletions

3
.gitignore vendored
View file

@ -31,4 +31,5 @@ env.*.sh
xgen/v0.9/*
xgen/v1.0/*
!xgen/v0.9/index.html
!xgen/v1.0/index.html
!xgen/v1.0/index.html
!xgen/v1.0/umi.js

File diff suppressed because one or more lines are too long

View file

@ -218,5 +218,10 @@ func (dsl *DSL) replaceAdminRoot() error {
root := strings.TrimPrefix(dsl.Optional.AdminRoot, "/")
root = strings.TrimSuffix(root, "/")
return data.ReplaceXGen("/__yao_admin_root/", fmt.Sprintf("/%s/", root))
err := data.ReplaceXGen("/__yao_admin_root/", fmt.Sprintf("/%s/", root))
if err != nil {
return err
}
return data.ReplaceXGen("\"__yao_admin_root\"", fmt.Sprintf("\"%s\"", root))
}

2
xgen/v1.0/umi.js Normal file
View file

@ -0,0 +1,2 @@
var path = "/__yao_admin_root/";
var foo = concat("__yao_admin_root");