diff --git a/platformapi/tao_vegetable/api_model.go b/platformapi/tao_vegetable/api_model.go index 55475e59..76e51bdf 100644 --- a/platformapi/tao_vegetable/api_model.go +++ b/platformapi/tao_vegetable/api_model.go @@ -52,13 +52,13 @@ func CallBackResultSign(err error) *CallBackResult { return &CallBackResult{ Success: true, ErrCode: "SUCCESS", - ErrMsg: err.Error(), + ErrMsg: "", } } return &CallBackResult{ Success: false, ErrCode: "sign-check-failure", - ErrMsg: "", + ErrMsg: err.Error(), } } diff --git a/platformapi/tao_vegetable/order_afs.go b/platformapi/tao_vegetable/order_afs.go index 2cf1d047..3e3f9832 100644 --- a/platformapi/tao_vegetable/order_afs.go +++ b/platformapi/tao_vegetable/order_afs.go @@ -95,6 +95,10 @@ func (a *API) UserApplyRefund(c *http.Request) (*UserApplyRefundCallBack, error) if err != nil { return nil, err } + + if len(data) == 0 { + return nil, err + } var result *UserApplyRefundCallBack if err := json.Unmarshal(data, result); err != nil { return nil, err @@ -108,6 +112,10 @@ func (a *API) UserCancelRefundApply(c *http.Request) (*UserCancelRefundApply, er if err != nil { return nil, err } + + if len(data) == 0 { + return nil, err + } var result *UserCancelRefundApply if err := json.Unmarshal(data, result); err != nil { return nil, err @@ -119,6 +127,9 @@ func (a *API) UserCancelRefundApply(c *http.Request) (*UserCancelRefundApply, er func (a *API) OnSaleRefundOrder(c *http.Request) (*OnSaleCancel, error) { body, _ := ioutil.ReadAll(c.Body) + if len(body) == 0 { + return nil, nil + } var onSaleOrder *OnSaleCancel if err := json.Unmarshal(body, &onSaleOrder); err != nil { return nil, err @@ -132,6 +143,10 @@ func (a *API) RefundOrderFinish(c *http.Request) (*RefundOrderFinish, error) { if err != nil { return nil, err } + + if len(data) == 0 { + return nil, nil + } var result *RefundOrderFinish if err := json.Unmarshal(data, result); err != nil { return nil, err