Authored by Lixiaodi

图片地址兼容

... ... @@ -65,6 +65,9 @@ public class ImageUrlAssist {
if (((String)imageUrl).startsWith("http://")) {
return (String)imageUrl;
}
if (((String)imageUrl).startsWith("https://")) {
return (String)imageUrl;
}
if (StringUtils.isEmpty(background)) {
background = INIT_BACKGROUND;
}
... ...
... ... @@ -192,6 +192,10 @@ public class ProductSearchServiceImpl implements ProductSearchService {
}
}
public static void main(String[] args) {
System.out.println(fillProductImgUrl("https://img12.static.yhbimg.com/goodsimg/2019/04/17/17/021560b1bd437ded9a66dd15c29c81c53d.jpg"));
}
protected void processProductSales(JSONArray productList) {
if(CollectionUtils.isEmpty(productList)){
return;
... ... @@ -270,6 +274,9 @@ public class ProductSearchServiceImpl implements ProductSearchService {
if (imgUrl.startsWith("http://")) {
return imgUrl;
}
if (imgUrl.startsWith("https://")) {
return imgUrl;
}
return ImageUrlAssist.getAllProductPicUrl(imgUrl, "goodsimg", "center", "d2hpdGU=");
}
... ...