浏览代码

转链

master
huangjiajun 8 个月前
父节点
当前提交
e646d4fee6
共有 1 个文件被更改,包括 16 次插入0 次删除
  1. +16
    -0
      taobao/convert_url.go

+ 16
- 0
taobao/convert_url.go 查看文件

@@ -5,6 +5,7 @@ import (
"encoding/json"
"github.com/syyongx/php2go"
"strconv"
"strings"
)

type UrlInfo struct {
@@ -235,6 +236,9 @@ func (t *TB) WnConvertUrlSC(itemId, types, pid, externalId string) (*md.Converte
}

for _, v := range tmp.TbkScGeneralLinkConvertResponse.Data.MaterialUrlList.MaterialUrlList {
if v.LinkInfoDto.CouponLongUrl == "" && v.LinkInfoDto.CpsLongUrl == "" {
continue
}
url = v.LinkInfoDto.CouponLongUrl
tkl = v.LinkInfoDto.CouponFullTpwd
shortTkl = v.LinkInfoDto.CouponShortTpwd
@@ -263,6 +267,18 @@ func (t *TB) WnConvertUrlSC(itemId, types, pid, externalId string) (*md.Converte
shortTkl = v.LinkInfoDto.CpsShortTpwd
itemUrl = url
}
isDown := "0"
if tkl == "" {
isDown = "2"
}
if strings.Contains(string(resp), "该商品已下架") {
isDown = "1"
}
if isDown == "1" {
tkl = ""
shortTkl = ""
itemId = ""
}
return &md.ConvertedUrls{
Tkl: tkl,
ShortTkl: shortTkl,


正在加载...
取消
保存