提交 1f6e689e 编写于 作者: A astaxie

beego: fix #652

上级 af4f1538
......@@ -7,6 +7,7 @@ package beego
import (
"net/http"
"strings"
beecontext "github.com/astaxie/beego/context"
"github.com/astaxie/beego/middleware"
......@@ -258,7 +259,9 @@ func addPrefix(t *Tree, prefix string) {
}
for _, l := range t.leaves {
if c, ok := l.runObject.(*controllerInfo); ok {
c.pattern = prefix + c.pattern
if !strings.HasPrefix(c.pattern, prefix) {
c.pattern = prefix + c.pattern
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册