From a43780ea7974eae085911618638e06dbafa33d01 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 09:18:29 +0800 Subject: [PATCH] 1 --- controllers/taobao_vegetable.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/controllers/taobao_vegetable.go b/controllers/taobao_vegetable.go index 96e4d491e..1e57e22f5 100644 --- a/controllers/taobao_vegetable.go +++ b/controllers/taobao_vegetable.go @@ -96,7 +96,7 @@ func (c *TaoBaoVegetableController) OrderStatus() { // 验签 sign := Sign(values, utils.Format4Output(order, false), api.TaoVegetableApi.GetAppSecret()) - if sign != values.Get("sign") { + if sign != values.Get("sign") && order != nil { c.Data["json"] = tao_vegetable.CallBackResultSign(fmt.Errorf("非法签名")) c.ServeJSON() return @@ -135,7 +135,7 @@ func (c *TaoBaoVegetableController) ApplyCancelOrder() { // 验签 sign := Sign(values, utils.Format4Output(afsOrder, false), api.TaoVegetableApi.GetAppSecret()) - if sign != values.Get("sign") { + if sign != values.Get("sign") && afsOrder != nil { c.Data["json"] = tao_vegetable.CallBackResultSign(fmt.Errorf("非法签名")) c.ServeJSON() return @@ -174,7 +174,7 @@ func (c *TaoBaoVegetableController) UserCancelRefund() { // 验签 sign := Sign(values, utils.Format4Output(afsOrder, false), api.TaoVegetableApi.GetAppSecret()) - if sign != values.Get("sign") { + if sign != values.Get("sign") && afsOrder != nil { c.Data["json"] = tao_vegetable.CallBackResultSign(fmt.Errorf("非法签名")) c.ServeJSON() return @@ -213,7 +213,7 @@ func (c *TaoBaoVegetableController) CancelOnSaleRefundOrder() { // 验签 sign := Sign(values, utils.Format4Output(afsOrder, false), api.TaoVegetableApi.GetAppSecret()) - if sign != values.Get("sign") { + if sign != values.Get("sign") && afsOrder != nil { c.Data["json"] = tao_vegetable.CallBackResultSign(fmt.Errorf("非法签名")) c.ServeJSON() return @@ -251,7 +251,7 @@ func (c *TaoBaoVegetableController) RefundOrderSuccess() { } // 验签 sign := Sign(values, utils.Format4Output(refundSuccess, false), api.TaoVegetableApi.GetAppSecret()) - if sign != values.Get("sign") { + if sign != values.Get("sign") && refundSuccess != nil { c.Data["json"] = tao_vegetable.CallBackResultSign(fmt.Errorf("非法签名")) c.ServeJSON() return