新查询upc优化
This commit is contained in:
@@ -136,7 +136,7 @@ func (a *API) GetNetUpcInfo(bar string) (getNetUpcInfo *GetNetUpcInfoResult, err
|
|||||||
getNetUpcInfo = &GetNetUpcInfoResult{}
|
getNetUpcInfo = &GetNetUpcInfoResult{}
|
||||||
body := result["fakeData"].(string)
|
body := result["fakeData"].(string)
|
||||||
if strings.Contains(body, "没有收录") {
|
if strings.Contains(body, "没有收录") {
|
||||||
return nil, err
|
return getNetUpcInfo, err
|
||||||
}
|
}
|
||||||
results := regexpUpc.FindAllStringSubmatch(body, -1)
|
results := regexpUpc.FindAllStringSubmatch(body, -1)
|
||||||
getNetUpcInfo.Upc = results[0][1]
|
getNetUpcInfo.Upc = results[0][1]
|
||||||
|
|||||||
Reference in New Issue
Block a user