Browse Source

更新

master
huangjiajun 1 year ago
parent
commit
b6e53af2f2
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      tik_tok/svc_tik_tok_goods.go

+ 4
- 0
tik_tok/svc_tik_tok_goods.go View File

@@ -3,6 +3,7 @@ package tik_tok
import ( import (
zhios_third_party_utils "code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/utils" zhios_third_party_utils "code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/utils"
"encoding/json" "encoding/json"
"fmt"
"github.com/syyongx/php2go" "github.com/syyongx/php2go"
"github.com/tidwall/gjson" "github.com/tidwall/gjson"
"strings" "strings"
@@ -58,6 +59,7 @@ func GoodsList(args map[string]string) []TikTokGoods {
} }
send, err := Send(args["appkey"], args["appSecret"], "alliance.materialsProductsSearch", params, args["acctoken"]) send, err := Send(args["appkey"], args["appSecret"], "alliance.materialsProductsSearch", params, args["acctoken"])
var goodsList = make([]TikTokGoods, 0) var goodsList = make([]TikTokGoods, 0)
fmt.Println("抖音商品", args, send, err)
product := gjson.Get(send, "data.products").String() product := gjson.Get(send, "data.products").String()
if err != nil || product == "" { if err != nil || product == "" {
return goodsList return goodsList
@@ -69,6 +71,8 @@ func GoodsList(args map[string]string) []TikTokGoods {
} }
err = json.Unmarshal([]byte(send), &lmData) err = json.Unmarshal([]byte(send), &lmData)
if err != nil { if err != nil {
fmt.Println("抖音商品1", err)

return goodsList return goodsList
} }
for _, v := range lmData.Data.Products { for _, v := range lmData.Data.Products {


Loading…
Cancel
Save