|
@@ -62,7 +62,12 @@ func (m *S3Oss) UploadFile(fileName, localFile, savePath string) (resourceUrl st
|
|
}
|
|
}
|
|
}()
|
|
}()
|
|
|
|
|
|
- endpoint := utils.S3Endpoint
|
|
|
|
|
|
+ // 默认使用后端这个, 这里有两个配置的原因是
|
|
|
|
+ // 前端上传跨域问题可能会使用反向代理来解决, 这样的话同一个endpoint就会导致一端正常另一端不正常
|
|
|
|
+ endpoint := utils.S3BackEndpoint
|
|
|
|
+ if endpoint == "" {
|
|
|
|
+ endpoint = utils.S3Endpoint
|
|
|
|
+ }
|
|
accessKey := utils.S3AccessKeyId
|
|
accessKey := utils.S3AccessKeyId
|
|
secretKey := utils.S3AccessKeySecret
|
|
secretKey := utils.S3AccessKeySecret
|
|
region := utils.S3Region
|
|
region := utils.S3Region
|