From 5b87dc8a9929715c440906ec800872401575ba6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Thu, 23 Jun 2022 11:17:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/enterprise/enterprise.go | 2 +- controllers/enterprise_callback.go | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/business/enterprise/enterprise.go b/business/enterprise/enterprise.go index 7b2d5c25c..ff380a0ac 100644 --- a/business/enterprise/enterprise.go +++ b/business/enterprise/enterprise.go @@ -31,7 +31,7 @@ func UpdateEnterpriseSuite(data *enterprise_wechat.SuiteTicketInfo) error { if data.SuiteTicket != "" && data.TimeStamp > 0 { EnterpriseSuite = data } - + globals.SugarLogger.Debug("修改数据库配置数据-》", data.SuiteTicket) // 修改数据库 db := dao.GetDB() config := &legacymodel.Config{ diff --git a/controllers/enterprise_callback.go b/controllers/enterprise_callback.go index 83c763b55..b350229ae 100644 --- a/controllers/enterprise_callback.go +++ b/controllers/enterprise_callback.go @@ -20,6 +20,7 @@ type EnterpriseController struct { // 消息结构体将使用创建应用时的EncodingAESKey进行加密(特别注意, 在第三方回调事件中使用加解密算法,receiveid的内容为suiteid) // ,请参考接收消息解析数据包。 func (e *EnterpriseController) EnterpriseCallback() { + globals.SugarLogger.Debug("==============企业微信通知回调") r := e.Ctx.Request switch e.Ctx.Request.Method { case http.MethodPost: @@ -35,6 +36,7 @@ func (e *EnterpriseController) EnterpriseCallback() { wxcpt := call.NewWXBizMsgCrypt(call.Token, call.EncodingAeskey, call.ReceiverId, call.JsonType) msg, err_ := wxcpt.DecryptMsg(msg_signature, timestamp, nonce, body) + globals.SugarLogger.Debug("==============企业微信通知回调String", string(msg)) if err_.ErrCode != 0 { e.Abort("404") return @@ -61,7 +63,9 @@ func (e *EnterpriseController) EnterpriseCallback() { //} // if strings.Contains(string(msg), "SuiteTicket") { + globals.SugarLogger.Debug("==============企业微信通知回调SuiteTicket") data, err := api.EnterpriseChatHeadApi.GetEnterpriseMsg(msg) + globals.SugarLogger.Debug("==============企业微信通知回调SuiteTicket->data", data.SuiteTicket) if err != nil { globals.SugarLogger.Debug("Unmarshal SuiteTicket err : ", err) } else {