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)