diff --git a/core/src/interface.ts b/core/src/interface.ts index 12b997d..0a6d10f 100644 --- a/core/src/interface.ts +++ b/core/src/interface.ts @@ -220,6 +220,8 @@ export interface AWSConfig { expires?: number /** publicDomain */ publicDomain?: string; + /** forcePathStyle */ + forcePathStyle?: boolean; } /** diff --git a/file/src/file.ts b/file/src/file.ts index b855011..2911d4f 100644 --- a/file/src/file.ts +++ b/file/src/file.ts @@ -78,7 +78,7 @@ export class CoolFile { this.client = new QINIU.auth.digest.Mac(accessKeyId, accessKeySecret); } if (aws) { - const { accessKeyId, secretAccessKey, region, publicDomain } = aws; + const { accessKeyId, secretAccessKey, region, publicDomain, forcePathStyle } = aws; this.client = new S3Client({ region, credentials: { accessKeyId, secretAccessKey }, @@ -86,6 +86,8 @@ export class CoolFile { endpoint: publicDomain ? publicDomain : `https://s3.${region}.amazonaws.com`, + // minio 使用域名时,forcePathStyle为true时,不增加二级域名,而是 xx.com/bucket的形式 + forcePathStyle: forcePathStyle ? forcePathStyle : false, }); } } diff --git a/file/src/interface.ts b/file/src/interface.ts index 52ff144..70e8178 100644 --- a/file/src/interface.ts +++ b/file/src/interface.ts @@ -108,6 +108,8 @@ export interface AWSConfig { expires?: number; /** publicDomain */ publicDomain?: string; + /** forcePathStyle */ + forcePathStyle?: boolean; } export interface QINIUConfig {