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",