From 7e57007cc0248254428555edb1629e7563a7ce1e Mon Sep 17 00:00:00 2001 From: johlanse Date: Fri, 12 Aug 2022 09:46:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=BE=AE=E4=BF=A1=E5=A4=84?= =?UTF-8?q?=E7=90=86=E6=B5=81=E7=A8=8Bbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/wx.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/web/wx.go b/web/wx.go index 824454f..cfc970f 100644 --- a/web/wx.go +++ b/web/wx.go @@ -19,10 +19,6 @@ import ( "github.com/johlanse/study_xxqg/utils/update" ) -func init() { - initWechat() -} - var ( wx *mp.WeiXin lastNonce = "" @@ -192,6 +188,9 @@ func sendMsg(id, message string) { * @param req */ func HandleWechat(rep http.ResponseWriter, req *http.Request) { + if wx == nil { + initWechat() + } wx.ServeHTTP(rep, req) }