From f7bb3bc8dc6ede8eb954924d15638e0cf2ca2d9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Thu, 29 Jun 2023 10:13:15 +0800 Subject: [PATCH] 1 --- platformapi/tao_vegetable/order_afs.go | 6 +++--- platformapi/tao_vegetable/order_delivery.go | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/platformapi/tao_vegetable/order_afs.go b/platformapi/tao_vegetable/order_afs.go index 3e3f9832..c90afe33 100644 --- a/platformapi/tao_vegetable/order_afs.go +++ b/platformapi/tao_vegetable/order_afs.go @@ -100,7 +100,7 @@ func (a *API) UserApplyRefund(c *http.Request) (*UserApplyRefundCallBack, error) return nil, err } var result *UserApplyRefundCallBack - if err := json.Unmarshal(data, result); err != nil { + if err := json.Unmarshal(data, &result); err != nil { return nil, err } return result, nil @@ -117,7 +117,7 @@ func (a *API) UserCancelRefundApply(c *http.Request) (*UserCancelRefundApply, er return nil, err } var result *UserCancelRefundApply - if err := json.Unmarshal(data, result); err != nil { + if err := json.Unmarshal(data, &result); err != nil { return nil, err } return result, nil @@ -148,7 +148,7 @@ func (a *API) RefundOrderFinish(c *http.Request) (*RefundOrderFinish, error) { return nil, nil } var result *RefundOrderFinish - if err := json.Unmarshal(data, result); err != nil { + if err := json.Unmarshal(data, &result); err != nil { return nil, err } return result, nil diff --git a/platformapi/tao_vegetable/order_delivery.go b/platformapi/tao_vegetable/order_delivery.go index 0dbe3079..a013692f 100644 --- a/platformapi/tao_vegetable/order_delivery.go +++ b/platformapi/tao_vegetable/order_delivery.go @@ -16,6 +16,9 @@ import ( func (a *API) ReaderOrderInfo(c *http.Request) (*CallbackOrder, error) { body, _ := ioutil.ReadAll(c.Body) + if len(body) == 0 { + return nil, nil + } var callbackOrder *CallbackOrder if err := json.Unmarshal(body, &callbackOrder); err != nil { return nil, err