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