From 58da22323f9ced9706a9e5e023da4e180fefc54c Mon Sep 17 00:00:00 2001 From: richboo111 Date: Wed, 12 Jul 2023 17:09:03 +0800 Subject: [PATCH] 1 --- business/jxutils/unipush/push.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/business/jxutils/unipush/push.go b/business/jxutils/unipush/push.go index 8a9003001..f347ce5c8 100644 --- a/business/jxutils/unipush/push.go +++ b/business/jxutils/unipush/push.go @@ -182,6 +182,7 @@ func pushMsgByUniApp(storeId int, storeName string, cID []string, msg string, bo var ( errs []error options = make(map[string]interface{}, 0) + offMsg MsgContext ) if flag == FlagOrder { options = map[string]interface{}{ @@ -214,6 +215,9 @@ func pushMsgByUniApp(storeId int, storeName string, cID []string, msg string, bo }, } } + if err := json.Unmarshal([]byte(body), &offMsg); err != nil { + globals.SugarLogger.Debugf("pushMsgByUniApp marshal err") + } for _, v := range cID { param := map[string]interface{}{ "request_id": utils.Int64ToStr(time.Now().Unix()) + "_" + utils.Int2Str(storeId), @@ -231,10 +235,9 @@ func pushMsgByUniApp(storeId int, storeName string, cID []string, msg string, bo "ups": map[string]interface{}{ "notification": map[string]interface{}{ "title": storeName, - "body": msg, + "body": offMsg.Context + "(" + offMsg.VendorName + offMsg.OrderSqs + "号订单)", "click_type": "startapp", - //"notify_id": rand.Intn(1000000000), - "notify_id": time.Now().Unix(), // 每次通知需要不一样 范围:0-2147483647 + "notify_id": time.Now().Unix(), // 每次通知需要不一样 范围:0-2147483647 }, "options": options, },