Browse Source

抖音穿山甲

master
huangjiajun 10 months ago
parent
commit
4626cc94c2
1 changed files with 18 additions and 4 deletions
  1. +18
    -4
      csjplatform/activity.go

+ 18
- 4
csjplatform/activity.go View File

@@ -2,9 +2,11 @@ package csjplatform

import (
"fmt"
"github.com/syyongx/php2go"
"github.com/tidwall/gjson"
)

func Activity(args map[string]string) (string, error) {
func Activity(args map[string]string) (map[string]string, string) {
params := map[string]interface{}{
"external_info": args["external_info"],
"material_id": args["material_id"],
@@ -14,7 +16,19 @@ func Activity(args map[string]string) (string, error) {
}

send, err := Send(args["app_id"], args["app_secret"], "aggregate/h5", params)
fmt.Println(send)
fmt.Println(err)
return send, err
var data = map[string]string{}
if err != nil {
fmt.Println("抖音信息=====", send)

return data, err.Error()
}
if gjson.Get(send, "code").Int() != 10000 {
fmt.Println("抖音信息=====", send)

return data, gjson.Get(send, "sub_msg").String()
}
data["deeplink"] = gjson.Get(send, "data.deep_link").String()
data["content"] = php2go.Base64Encode(gjson.Get(send, "data.share_command").String())
data["qr_code"] = gjson.Get(send, "data.qrcode.url").String()
return data, ""
}

Loading…
Cancel
Save