From c3b75656a47bb6c86080889f4054115d26e4b834 Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Mon, 6 Nov 2023 17:28:34 +0800 Subject: [PATCH] fix --- server/feishu-sync/internal/handler/webhookhandler.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/server/feishu-sync/internal/handler/webhookhandler.go b/server/feishu-sync/internal/handler/webhookhandler.go index fcce55eb..137a5d28 100644 --- a/server/feishu-sync/internal/handler/webhookhandler.go +++ b/server/feishu-sync/internal/handler/webhookhandler.go @@ -16,7 +16,9 @@ import ( func WebhookHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { - + b, _ := io.ReadAll(r.Body) + defer r.Body.Close() + log.Println("收到body信息:", string(b)) var req types.WebhookReq userinfo, err := basic.RequestParse(w, r, svcCtx, &req) if err != nil { @@ -31,10 +33,7 @@ func WebhookHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { w.Write(b) return } - b, _ := io.ReadAll(r.Body) - defer r.Body.Close() log.Println("收到头消息:", r.Header) - log.Println("收到body信息:", string(b)) // 创建一个业务逻辑层实例 l := logic.NewWebhookLogic(r.Context(), svcCtx)