|
@@ -11,6 +11,7 @@ import (
|
|
|
"github.com/aws/aws-sdk-go/service/s3"
|
|
|
"io/ioutil"
|
|
|
"net/http"
|
|
|
+ "os"
|
|
|
"time"
|
|
|
)
|
|
|
|
|
@@ -60,12 +61,13 @@ func (m *S3Oss) UploadFile(fileName, localFile, savePath string) (resourceUrl st
|
|
|
if err != nil {
|
|
|
fmt.Println(err.Error())
|
|
|
}
|
|
|
+ _ = os.Remove(localFile)
|
|
|
}()
|
|
|
|
|
|
// 默认使用后端这个, 这里有两个配置的原因是
|
|
|
// 前端上传跨域问题可能会使用反向代理来解决, 这样的话同一个endpoint就会导致一端正常另一端不正常
|
|
|
endpoint := utils.S3Endpoint
|
|
|
-
|
|
|
+
|
|
|
accessKey := utils.S3AccessKeyId
|
|
|
secretKey := utils.S3AccessKeySecret
|
|
|
region := utils.S3Region
|