From 463b35ed0d2739ad2bf9e086bc01ca35a5d246ac Mon Sep 17 00:00:00 2001 From: John Date: Fri, 9 Nov 2018 23:29:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9Bgview=E5=86=85=E7=BD=AE?= =?UTF-8?q?=E5=8F=98=E9=87=8F=E5=9C=A8=E6=B2=A1=E6=9C=89=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E6=96=87=E4=BB=B6=E6=97=B6=E7=9A=84=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- g/net/ghttp/ghttp_response_view.go | 8 +++++++- geg/other/test.go | 7 +++++-- 2 files changed, 12 insertions(+), 3 deletions(-) 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