From 1a034d7e9b54b12ba44dd95054c2111be16e976d Mon Sep 17 00:00:00 2001 From: momo <1012651275@qq.com> Date: Thu, 26 Oct 2023 15:36:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:upload=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/basic/basic.go | 6 +++--- utils/file/upload.go | 20 ++++++-------------- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/utils/basic/basic.go b/utils/basic/basic.go index d8d4eae0..fc936c52 100644 --- a/utils/basic/basic.go +++ b/utils/basic/basic.go @@ -11,12 +11,12 @@ import ( ) // 全局的BucketName -var StorageBucketName = aws.String("storage.fusenpack.com") +var StorageBucketName = aws.String("fusenstorage") // 全局的BucketName 缓存使用 -var TempfileBucketName = aws.String("tempfile.fusenpack.com") +var TempfileBucketName = aws.String("fusentempfile") -var FusenLogoDbBucketName = aws.String("fusenlogodb") +var FusenLogoDbBucketName = aws.String("fusenstorage") const UploadFileLimitSize = 200 << 20 diff --git a/utils/file/upload.go b/utils/file/upload.go index c55a6699..69c94f31 100644 --- a/utils/file/upload.go +++ b/utils/file/upload.go @@ -57,17 +57,13 @@ func (upload *Upload) UploadFileByBase64(req *UploadBaseReq) (*UploadBaseRes, er switch req.UploadBucket { case 2: bucketName = basic.TempfileBucketName - // 设置AWS会话的区域 - upload.AwsSession.Config.Region = aws.String("us-west-1") case 3: - bucketName = basic.FusenLogoDbBucketName - // 设置AWS会话的区域 - upload.AwsSession.Config.Region = aws.String("us-east-2") + bucketName = basic.StorageBucketName default: bucketName = basic.StorageBucketName - // 设置AWS会话的区域 - upload.AwsSession.Config.Region = aws.String("us-west-1") } + // 设置AWS会话的区域 + upload.AwsSession.Config.Region = aws.String("us-east-2") // 创建新的S3服务实例 svc := s3.New(upload.AwsSession) @@ -197,17 +193,13 @@ func (upload *Upload) UploadFileByByte(req *UploadBaseReq) (*UploadBaseRes, erro switch req.UploadBucket { case 2: bucketName = basic.TempfileBucketName - // 设置AWS会话的区域 - upload.AwsSession.Config.Region = aws.String("us-west-1") case 3: - bucketName = basic.FusenLogoDbBucketName - // 设置AWS会话的区域 - upload.AwsSession.Config.Region = aws.String("us-east-2") + bucketName = basic.StorageBucketName default: bucketName = basic.StorageBucketName - // 设置AWS会话的区域 - upload.AwsSession.Config.Region = aws.String("us-west-1") } + // 设置AWS会话的区域 + upload.AwsSession.Config.Region = aws.String("us-east-2") // 创建新的S3服务实例 svc := s3.New(upload.AwsSession)