fix issue of ghttp.Request.GetVar

This commit is contained in:
John 2018-12-22 11:52:12 +08:00
parent 2063f662d3
commit 503446afc7

View File

@ -29,7 +29,7 @@ func (r *Request) GetRequest(key string, def ... []string) []string {
func (r *Request) GetRequestVar(key string, def ... interface{}) gvar.VarRead {
value := r.GetRequest(key)
if value != nil {
return gvar.New(value, false)
return gvar.New(value[0], false)
}
if len(def) > 0 {
return gvar.New(def[0], false)