From 3fd22e6ad1ea685554bb89d86388382a0cd21d56 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Fri, 30 Sep 2022 10:00:45 +0800 Subject: [PATCH] =?UTF-8?q?add=20reverse:for=20v1.1.3=20=E6=8A=96=E9=9F=B3?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tik_tok/svc_tik_tok_goods.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tik_tok/svc_tik_tok_goods.go b/tik_tok/svc_tik_tok_goods.go index 63caa86..6847946 100644 --- a/tik_tok/svc_tik_tok_goods.go +++ b/tik_tok/svc_tik_tok_goods.go @@ -5,6 +5,7 @@ import ( "encoding/json" "github.com/syyongx/php2go" "github.com/tidwall/gjson" + "strings" ) //抖音商品 @@ -79,7 +80,11 @@ func GoodsList(args map[string]string) []TikTokGoods { //详情 func GetDetail(args map[string]string) TikTokGoods { - params := map[string]interface{}{"product_ids": []string{args["id"]}, "with_share_status": true} + productIds := strings.Split(args["id"], ",") + if len(productIds) == 0 { + return TikTokGoods{} + } + params := map[string]interface{}{"product_ids": productIds, "with_share_status": true} send, err := Send(args["appkey"], args["appSecret"], "alliance.materialsProductsDetails", params, args["acctoken"]) var goodsList = TikTokGoods{} product := gjson.Get(send, "data.products").String()