diff --git a/g/net/ghttp/ghttp_response_view.go b/g/net/ghttp/ghttp_response_view.go index 7abffa7c3..b57a19b57 100644 --- a/g/net/ghttp/ghttp_response_view.go +++ b/g/net/ghttp/ghttp_response_view.go @@ -65,7 +65,13 @@ func (r *Response) buildInVars(params map[string]interface{}) map[string]interfa if params == nil { params = make(map[string]interface{}) } - params["Config"] = gins.Config().GetMap("") + + c := gins.Config() + if c.GetFilePath() != "" { + params["Config"] = c.GetMap("") + } else { + params["Config"] = nil + } params["Cookie"] = r.request.Cookie.Map() params["Session"] = r.request.Session.Data() return params diff --git a/geg/other/test.go b/geg/other/test.go index f080414e3..dbf231df7 100644 --- a/geg/other/test.go +++ b/geg/other/test.go @@ -1,7 +1,10 @@ package main -import "fmt" +import ( + "fmt" + "gitee.com/johng/gf/g/frame/gins" +) func main() { - fmt.Print(1) + fmt.Print(gins.Config().GetFilePath()) } \ No newline at end of file