Browse Source

Merge branch 'develop' of k.zhang/duoduo into test

k.zhang 1 year ago
parent
commit
d5b28c0a63
1 changed files with 12 additions and 6 deletions
  1. 12 6
      apis/shanghu/merchant.card.go

+ 12 - 6
apis/shanghu/merchant.card.go

@@ -238,12 +238,18 @@ func GetMerchantCanvasCard(c *gin.Context) {
 	outData.Static.Background = "/images/背景.jpg"
 	var swiperList []models.SwiperList
 	var rightButton models.RightButton
-	err = json.Unmarshal([]byte(merchantCard.Picture), &swiperList)
-	if err != nil {
-		fmt.Println("picture")
-		app.Error(c, 500, err, err.Error())
-		return
-	}
+	var swiper models.SwiperList
+
+	swiper.ID = 0
+	swiper.URL = merchantCard.Picture
+	swiperList = append(swiperList, swiper)
+	//err = json.Unmarshal([]byte(merchantCard.Picture), &swiperList)
+	//if err != nil {
+	//	fmt.Println("picture")
+	//	app.Error(c, 500, err, err.Error())
+	//	return
+	//}
+
 	outData.SwiperList = swiperList
 
 	rightButton.ImageURL = "/images/资源 24.png"