新查询upc优化

This commit is contained in:
苏尹岚
2020-04-17 17:52:17 +08:00
parent 118a68f5e8
commit ac2c0da81f

View File

@@ -135,6 +135,9 @@ func (a *API) GetNetUpcInfo(bar string) (getNetUpcInfo *GetNetUpcInfoResult, err
if err == nil {
getNetUpcInfo = &GetNetUpcInfoResult{}
body := result["fakeData"].(string)
if strings.Contains(body, "没有收录") {
return nil, err
}
results := regexpUpc.FindAllStringSubmatch(body, -1)
getNetUpcInfo.Upc = results[0][1]
getNetUpcInfo.Name = results[1][1]