Browse Source

兼容申万系统缩略图

kobe6258 3 weeks ago
parent
commit
3dd83a7d8a
1 changed files with 7 additions and 7 deletions
  1. 7 7
      services/file.go

+ 7 - 7
services/file.go

@@ -165,12 +165,7 @@ func GetResourceUrlBySvgImg(imgData string, picType ...string) (resourceUrl stri
 			}
 			doneChannel <- true
 		}()
-		defer func() {
-			_ = os.Remove(outFileName)
-			if err != nil {
-				utils.FileLog.Info("删除生产的图片文件失败, err: " + err.Error())
-			}
-		}()
+
 
 		select {
 		case <-time.After(30 * time.Second):
@@ -193,7 +188,12 @@ func GetResourceUrlBySvgImg(imgData string, picType ...string) (resourceUrl stri
 			return
 		}
 	}
-
+	defer func() {
+		_ = os.Remove(outFileName)
+		if err != nil {
+			utils.FileLog.Info("删除生产的图片文件失败, err: " + err.Error())
+		}
+	}()
 	//上传到阿里云 和 minio
 	ossClient := NewOssClient()
 	if ossClient == nil {