@ -28,9 +28,10 @@ func UploadFile(c *gin.Context) (result.Data, error) {
return nil, errors.NewBusinessError("文件不存在")
}
fmt.Println(filePath, destPath)
fmt.Println(filePath, destPath, isDeleteLocal)
url, err := global.Storage.Upload(filePath, destPath)
if err != nil {
fmt.Println(err.Error())
return nil, err
if isDeleteLocal == "1" {
@ -38,7 +38,7 @@ func (s *CosStorage) Upload(filePath, destPath string) (string, error) {
_, _, err = client.Object.Upload(
context.Background(), destPath, filePath, nil,
context.Background(), destPath, filePath, &cos.MultiUploadOptions{ThreadPoolSize: 5, PartSize: 30},
)
return "", err