zwxi 11 ay önce
ebeveyn
işleme
9d8d378a8e
1 değiştirilmiş dosya ile 2 ekleme ve 2 silme
  1. 2 2
      controller/public.go

+ 2 - 2
controller/public.go

@@ -682,7 +682,7 @@ func BannerDowload(c *gin.Context) {
 	}
 	}
 	resourceUrl := ""
 	resourceUrl := ""
 
 
-	if item == nil {
+	if item.ImgURL == "" {
 		randStr := utils.GetRandStringNoSpecialChar(28)
 		randStr := utils.GetRandStringNoSpecialChar(28)
 		jpegPath := `./static/` + randStr + ".jpeg"
 		jpegPath := `./static/` + randStr + ".jpeg"
 		err := services.ReportToJpeg(req.BannerUrl, jpegPath)
 		err := services.ReportToJpeg(req.BannerUrl, jpegPath)
@@ -700,7 +700,7 @@ func BannerDowload(c *gin.Context) {
 		}()
 		}()
 
 
 		//上传到阿里云
 		//上传到阿里云
-		resourceUrl, err := services.UploadAliyun(randStr+".jpeg", jpegPath)
+		resourceUrl, err = services.UploadAliyun(randStr+".jpeg", jpegPath)
 		if err != nil {
 		if err != nil {
 			response.FailData("文件上传失败", "文件上传失败,Err:"+err.Error(), c)
 			response.FailData("文件上传失败", "文件上传失败,Err:"+err.Error(), c)
 			return
 			return