parse url to params
/object/login/2009/07/11 parse to ObjectController Login function params:map[0:2009 1:07 2:11]
Showing
1 changed file
with
2 additions
and
2 deletions
| ... | @@ -548,9 +548,9 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request) | ... | @@ -548,9 +548,9 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request) |
| 548 | if strings.HasPrefix(strings.ToLower(requestPath), "/"+cName+"/"+strings.ToLower(mName)) { | 548 | if strings.HasPrefix(strings.ToLower(requestPath), "/"+cName+"/"+strings.ToLower(mName)) { |
| 549 | //parse params | 549 | //parse params |
| 550 | otherurl := requestPath[len("/"+cName+"/"+strings.ToLower(mName)):] | 550 | otherurl := requestPath[len("/"+cName+"/"+strings.ToLower(mName)):] |
| 551 | if len(otherurl) > 1 && otherurl[0] != '/' { | 551 | if len(otherurl) > 1 { |
| 552 | plist := strings.Split(otherurl, "/") | 552 | plist := strings.Split(otherurl, "/") |
| 553 | for k, v := range plist { | 553 | for k, v := range plist[1:] { |
| 554 | params[strconv.Itoa(k)] = v | 554 | params[strconv.Itoa(k)] = v |
| 555 | } | 555 | } |
| 556 | } | 556 | } | ... | ... |
-
Please register or sign in to post a comment