路由规则找不到的时候提示用户

This commit is contained in:
刘祥超
2023-07-17 15:30:19 +08:00
parent 2d4378423b
commit a99bcdc437
6 changed files with 36 additions and 7 deletions

View File

@@ -28,7 +28,7 @@ func (this *IndexAction) RunGet(params struct {
}
this.Data["webId"] = webConfig.Id
locationMaps := []maps.Map{}
var locationMaps = []maps.Map{}
if webConfig.Locations != nil {
for _, location := range webConfig.Locations {
err := location.ExtractPattern()
@@ -46,7 +46,7 @@ func (this *IndexAction) RunGet(params struct {
this.ErrorPage(err)
return
}
pieces := strings.Split(location.Pattern, " ")
var pieces = strings.Split(location.Pattern, " ")
if len(pieces) == 2 {
m["pattern"] = pieces[1]
m["patternTypeName"] = serverconfigs.FindLocationPatternTypeName(location.PatternType())