From 6f44c537d6dc1d2e5240a4f3b1502f47e7c89c08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Mon, 3 Aug 2020 09:00:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=AC=E4=B8=9C=E5=95=86=E5=9F=8E=E8=AE=A2?= =?UTF-8?q?=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/partner/purchase/jdshop/callback.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/business/partner/purchase/jdshop/callback.go b/business/partner/purchase/jdshop/callback.go index 0ae0945c2..5d4ba5bb5 100644 --- a/business/partner/purchase/jdshop/callback.go +++ b/business/partner/purchase/jdshop/callback.go @@ -81,8 +81,8 @@ func result2Orders(msg *jdshopapi.CallBackResult) (order *model.GoodsOrder, err OrderCreatedAt: utils.Str2Time(msg.OrderStartTime), ConsigneeAddress: Decrypt(msg.ConsigneeInfo.FullAddress), ConsigneeName: Decrypt(msg.ConsigneeInfo.Fullname), - ConsigneeMobile: Decrypt(msg.ConsigneeInfo.Telephone), - ConsigneeMobile2: Decrypt(msg.ConsigneeInfo.Mobile), + ConsigneeMobile: Decrypt(msg.ConsigneeInfo.Mobile), + ConsigneeMobile2: Decrypt(msg.ConsigneeInfo.Telephone), ActualPayPrice: jxutils.StandardPrice2Int(utils.Str2Float64(msg.OrderPayment)), Status: model.OrderStatusNew, TotalShopMoney: utils.Float64TwoInt64(math.Round(float64(jxutils.StandardPrice2Int(utils.Str2Float64(msg.OrderPayment))) * jdshopapi.JdsPayPercentage)), @@ -170,6 +170,9 @@ func setJdsOrderSeq(order *model.GoodsOrder) (err error) { } func Decrypt(p string) (result string) { + if p == "" { + return "" + } data, _ := base64.StdEncoding.DecodeString(strings.ReplaceAll(p, " ", "+")) key := GetKey(hex.EncodeToString(data)[4:36]) data2, _ := base64.StdEncoding.DecodeString(key)