mirror of
https://gitee.com/johng/gf
synced 2026-06-06 16:21:40 +08:00
Merge branch 'master' of https://github.com/gogf/gf
This commit is contained in:
@ -24,10 +24,10 @@ import (
|
||||
// retrieved and overwrote in order of priority: router < query < body < form < custom.
|
||||
func (r *Request) GetRequest(key string, def ...interface{}) *gvar.Var {
|
||||
value := r.GetParam(key)
|
||||
if value == nil {
|
||||
if value.IsNil() {
|
||||
value = r.GetForm(key)
|
||||
}
|
||||
if value == nil {
|
||||
if value.IsNil() {
|
||||
r.parseBody()
|
||||
if len(r.bodyMap) > 0 {
|
||||
if v := r.bodyMap[key]; v != nil {
|
||||
@ -35,13 +35,13 @@ func (r *Request) GetRequest(key string, def ...interface{}) *gvar.Var {
|
||||
}
|
||||
}
|
||||
}
|
||||
if value == nil {
|
||||
if value.IsNil() {
|
||||
value = r.GetQuery(key)
|
||||
}
|
||||
if value == nil {
|
||||
if value.IsNil() {
|
||||
value = r.GetRouter(key)
|
||||
}
|
||||
if value != nil {
|
||||
if !value.IsNil() {
|
||||
return value
|
||||
}
|
||||
if len(def) > 0 {
|
||||
|
||||
Reference in New Issue
Block a user