1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-04 09:20:18 +00:00

fix autorouter params

This commit is contained in:
astaxie
2013-12-18 10:00:52 +08:00
parent 00065f2b08
commit 9edf3143e1
2 changed files with 24 additions and 0 deletions

View File

@ -634,6 +634,14 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
runrouter = controllerType
runMethod = mName
findrouter = true
//parse params
otherurl := requestPath[len("/"+cName+"/"+strings.ToLower(mName)):]
if len(otherurl) > 1 {
plist := strings.Split(otherurl, "/")
for k, v := range plist[1:] {
context.Input.Params[strconv.Itoa(k)] = v
}
}
break
}
}