From 5602454af97c8a90dc5e551dd27925706caa1786 Mon Sep 17 00:00:00 2001 From: John Date: Fri, 9 Nov 2018 23:57:20 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=B2=A1=E6=9C=89=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=96=87=E4=BB=B6=E6=97=B6=E7=9A=84Config=E5=86=85?= =?UTF-8?q?=E7=BD=AE=E5=8F=98=E9=87=8F=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- g/net/ghttp/ghttp_response_view.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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