Browse Source

add reverse:for v1.1.9 输出错误信息

tags/v1.1.10
huangjiajun 2 years ago
parent
commit
85fe4a9354
1 changed files with 24 additions and 12 deletions
  1. +24
    -12
      tik_tok/svc_tik_tok_convert.go

+ 24
- 12
tik_tok/svc_tik_tok_convert.go View File

@@ -19,21 +19,24 @@ func GoodsCreatePid(args map[string]string) map[string]string {
data["pid"] = gjson.Get(send, "data.pid").String()
return data
}
func GoodsConvertUrl(args map[string]string) map[string]string {
func GoodsConvertUrl(args map[string]string) (map[string]string, string) {
params := map[string]interface{}{"pid": args["pid"], "external_info": args["external_info"], "product_url": args["product_url"]}
send, err := Send(args["appkey"], args["appSecret"], "buyin.kolProductShare", params, args["acctoken"])
fmt.Println(send)
var data = map[string]string{}
if err != nil {
return data
return data, err.Error()
}
if gjson.Get(send, "code").Int() != 10000 {
return data, gjson.Get(send, "sub_msg").String()
}
data["deeplink"] = gjson.Get(send, "data.dy_deeplink").String()
data["content"] = php2go.Base64Encode(gjson.Get(send, "data.dy_password").String())
data["qr_code"] = gjson.Get(send, "data.qr_code.url").String()

return data
return data, ""
}
func ActConvertUrl(args map[string]string) map[string]string {
func ActConvertUrl(args map[string]string) (map[string]string, string) {
need_qr_code := "false"
if args["need_qr_code"] == "1" {
need_qr_code = "true"
@@ -43,13 +46,16 @@ func ActConvertUrl(args map[string]string) map[string]string {
fmt.Println(send)
var data = map[string]string{}
if err != nil {
return data
return data, err.Error()
}
if gjson.Get(send, "code").Int() != 10000 {
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
return data, ""
}
func LiveCreatePid(args map[string]string) map[string]string {

@@ -63,7 +69,7 @@ func LiveCreatePid(args map[string]string) map[string]string {
data["pid"] = gjson.Get(send, "data.pid").String()
return data
}
func LiveConvertUrl(args map[string]string) map[string]string {
func LiveConvertUrl(args map[string]string) (map[string]string, string) {

params := map[string]interface{}{"pid_info": map[string]interface{}{"pid": args["pid"], "external_info": args["external_info"]}, "buyin_id": args["open_id"]}
if args["need_qr_code"] == "1" {
@@ -79,27 +85,33 @@ func LiveConvertUrl(args map[string]string) map[string]string {
fmt.Println(send)
var data = map[string]string{}
if err != nil {
return data
return data, err.Error()
}
if gjson.Get(send, "code").Int() != 10000 {
return data, gjson.Get(send, "sub_msg").String()
}
data["deeplink"] = gjson.Get(send, "data.dy_deeplink").String()
data["content"] = php2go.Base64Encode(gjson.Get(send, "data.dy_password").String())
data["qr_code"] = gjson.Get(send, "data.qr_code.url").String()

return data
return data, ""
}

func RegimentalConvertUrl(args map[string]string) map[string]string {
func RegimentalConvertUrl(args map[string]string) (map[string]string, string) {

params := map[string]interface{}{"pid_info": map[string]interface{}{"pid": args["pid"], "external_info": args["external_info"]}, "open_id": args["open_id"]}
send, err := Send(args["appkey"], args["appSecret"], "buyin.instituteLiveShare", params, args["acctoken"])
fmt.Println(send)
var data = map[string]string{}
if err != nil {
return data
return data, err.Error()
}
if gjson.Get(send, "code").Int() != 10000 {
return data, gjson.Get(send, "sub_msg").String()
}
data["deeplink"] = gjson.Get(send, "data.dy_deeplink").String()
data["content"] = php2go.Base64Encode(gjson.Get(send, "data.dy_password").String())
data["qr_code"] = gjson.Get(send, "data.qr_code.url").String()

return data
return data, ""
}

Loading…
Cancel
Save