zwxi 11 månader sedan
förälder
incheckning
9d8d378a8e
1 ändrade filer med 2 tillägg och 2 borttagningar
  1. 2 2
      controller/public.go

+ 2 - 2
controller/public.go

@@ -682,7 +682,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)
@@ -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 {
 			response.FailData("文件上传失败", "文件上传失败,Err:"+err.Error(), c)
 			return