Commit 38ec79f3 by duwenjun

sku图片用cdn的

parent 34f6412c
......@@ -223,6 +223,8 @@ func InitSkuData(sku string) (data LySku) {
goodsImages := gjson.Get(sku, "goods_images").String()
goodsImages = strings.Replace(goodsImages, "http://img.ichunt.com", "https://img.ichunt.com", 1)
goodsImages = strings.Replace(goodsImages, "http://image.ichunt.net", "https://image.ichunt.net", 1)
goodsImages = strings.Replace(goodsImages, "https://image.ichunt.net", "https://imgscdn.ichunt.com", 1)
data.GoodsImages = goodsImages
canal := gjson.Get(sku, "canal").String()
......
......@@ -34,7 +34,13 @@ func (ls *LyService) GetGoodsImages(sku model.LySku, spu string) model.LySku {
sku.GoodsImages = ""
}
sku.GoodsImages = strings.Replace(sku.GoodsImages, "http://img.ichunt.com", "https://img.ichunt.com", 1)
sku.GoodsImages = strings.Replace(sku.GoodsImages, "http://image.ichunt.net", "https://image.ichunt.net", 1)
sku.GoodsImages = strings.Replace(sku.GoodsImages, "https://image.ichunt.net", "https://imgscdn.ichunt.com", 1)
sku.ImagesL = strings.Replace(sku.ImagesL, "http://img.ichunt.com", "https://img.ichunt.com", 1)
sku.ImagesL = strings.Replace(sku.ImagesL, "http://image.ichunt.net", "https://image.ichunt.net", 1)
sku.ImagesL = strings.Replace(sku.ImagesL, "https://image.ichunt.net", "https://imgscdn.ichunt.com", 1)
return sku
}
......
......@@ -234,6 +234,8 @@ func (qs *ZiyingService) ZyGoodsDetail(ctx *gin.Context, goodsIds []string, ch c
}
image := gjson.Get(goodsImages, "url").String()
image = strings.Replace(image, "http://img.ichunt.com", "https://img.ichunt.com", 1)
image = strings.Replace(image, "http://image.ichunt.net", "https://image.ichunt.net", 1)
image = strings.Replace(image, "https://image.ichunt.net", "https://imgscdn.ichunt.com", 1)
A.Set("goods_images", image)
pdf := gjson.Get(info, "pdf").String()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment