Kaynağa Gözat

Merge branch 'banner_down' into debug

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

+ 2 - 2
controller/public.go

@@ -684,7 +684,7 @@ func BannerDowload(c *gin.Context) {
 	}
 	resourceUrl := ""
 
-	if item == nil {
+	if item.ImgURL == "" {
 		randStr := utils.GetRandStringNoSpecialChar(28)
 		jpegPath := `./static/` + randStr + ".jpeg"
 		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 {
 			response.FailData("文件上传失败", "文件上传失败,Err:"+err.Error(), c)
 			return