mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 13:50:54 +00:00
Update tree.go
fix routers for: ``` /topic/:id/?:auth /topic/:id/?:auth:int ```
This commit is contained in:
parent
a89f14d80d
commit
5ad999a3d1
5
tree.go
5
tree.go
@ -208,6 +208,11 @@ func (t *Tree) addseg(segments []string, route interface{}, wildcards []string,
|
||||
} else {
|
||||
t.leaves = append(t.leaves, &leafInfo{runObject: route, wildcards: wildcards})
|
||||
}
|
||||
for i, v := range wildcards {
|
||||
if v==":" && i!=0{
|
||||
t.leaves = append(t.leaves, &leafInfo{runObject: route, wildcards: wildcards[:i+1]})
|
||||
}
|
||||
}
|
||||
} else {
|
||||
seg := segments[0]
|
||||
iswild, params, regexpStr := splitSegment(seg)
|
||||
|
Loading…
Reference in New Issue
Block a user