修复微信处理流程bug

This commit is contained in:
johlanse 2022-08-12 09:46:33 +08:00
parent d76db7d81e
commit 7e57007cc0
1 changed files with 3 additions and 4 deletions

View File

@ -19,10 +19,6 @@ import (
"github.com/johlanse/study_xxqg/utils/update" "github.com/johlanse/study_xxqg/utils/update"
) )
func init() {
initWechat()
}
var ( var (
wx *mp.WeiXin wx *mp.WeiXin
lastNonce = "" lastNonce = ""
@ -192,6 +188,9 @@ func sendMsg(id, message string) {
* @param req * @param req
*/ */
func HandleWechat(rep http.ResponseWriter, req *http.Request) { func HandleWechat(rep http.ResponseWriter, req *http.Request) {
if wx == nil {
initWechat()
}
wx.ServeHTTP(rep, req) wx.ServeHTTP(rep, req)
} }