Browse Source

Merge branch 'banner_down' into debug

zwxi 11 months ago
parent
commit
6fa56801ee
1 changed files with 2 additions and 2 deletions
  1. 2 2
      controller/public.go

+ 2 - 2
controller/public.go

@@ -684,7 +684,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)
@@ -702,7 +702,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