From ba4c95c7a6eb4952ae42cc00b1d5e0709a5a6163 Mon Sep 17 00:00:00 2001 From: ziming Date: Wed, 25 Mar 2026 14:22:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=87=E6=8D=A2=E4=B8=BB=E4=BD=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/server/http.go | 4 ++-- internal/service/notify.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/server/http.go b/internal/server/http.go index d6e9084..dbe207f 100644 --- a/internal/server/http.go +++ b/internal/server/http.go @@ -41,10 +41,10 @@ func NewHTTPServer( // 启星(启星-蓝色兄弟立减金代配) /voucher/qixing/v1/notify srv.Route("/voucher/").POST("qixing/v1/notify", tripartiteService.QiXingNotify) // 通知url必须为公网可访问的URL,必须为HTTPS,不能携带参数 - // https://域名.cn/voucher/v1/notify/123456 123456为微信主体商户号 + // https://域名.cn/voucher/v1/notify/123456 123456为微信主体商户号 /voucher/v1/notify/1100040695 // https://gateway.dev.cdlsxd.cn/voucher/v1/notify/123456 123456为微信主体商户号 测试环境 // https://voucher.86698.cn/voucher/v1/notify/123456 123456为微信主体商户号 正式环境 - srv.Route("/voucher/").POST("/notify/v1/{mch_id}", notifyService.Notify) + srv.Route("/voucher/").POST("/v1/notify/{mch_id}", notifyService.Notify) // 订单通知重试 -- 不健全 srv.Route("/voucher/").POST("orderNotifyRetry", cmb.OrderNotifyRetry) diff --git a/internal/service/notify.go b/internal/service/notify.go index c34ac9f..38610bc 100644 --- a/internal/service/notify.go +++ b/internal/service/notify.go @@ -46,7 +46,7 @@ func (srv *NotifyService) Notify(ctx http.Context) error { return fmt.Errorf("读取响应体失败: %w", err) } - if bodyBytes == nil { + if len(bodyBytes) == 0 { log.Errorf("微信回调通知[%s],响应体不能为空", mchId) return ctx.JSON(http2.StatusNetworkAuthenticationRequired, map[string]string{ "code": "FAIL",