mirror of
https://github.com/astaxie/beego.git
synced 2024-11-25 19:50:55 +00:00
beego: fix #652
This commit is contained in:
parent
af4f153830
commit
1f6e689e5d
@ -7,6 +7,7 @@ package beego
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"strings"
|
||||||
|
|
||||||
beecontext "github.com/astaxie/beego/context"
|
beecontext "github.com/astaxie/beego/context"
|
||||||
"github.com/astaxie/beego/middleware"
|
"github.com/astaxie/beego/middleware"
|
||||||
@ -258,9 +259,11 @@ func addPrefix(t *Tree, prefix string) {
|
|||||||
}
|
}
|
||||||
for _, l := range t.leaves {
|
for _, l := range t.leaves {
|
||||||
if c, ok := l.runObject.(*controllerInfo); ok {
|
if c, ok := l.runObject.(*controllerInfo); ok {
|
||||||
|
if !strings.HasPrefix(c.pattern, prefix) {
|
||||||
c.pattern = prefix + c.pattern
|
c.pattern = prefix + c.pattern
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user