mirror of
				https://github.com/dromara/RuoYi-Vue-Plus.git
				synced 2025-11-04 16:23:42 +08:00 
			
		
		
		
	update 优化是否启用路径样式注释
This commit is contained in:
		@@ -84,7 +84,7 @@ public class OssClient {
 | 
			
		||||
                AwsBasicCredentials.create(properties.getAccessKey(), properties.getSecretKey()));
 | 
			
		||||
 | 
			
		||||
            //MinIO 使用 HTTPS 限制使用域名访问,站点填域名。需要启用路径样式访问
 | 
			
		||||
            boolean pathStyle = !StringUtils.containsAny(properties.getEndpoint(), OssConstant.CLOUD_SERVICE);
 | 
			
		||||
            boolean isStyle = !StringUtils.containsAny(properties.getEndpoint(), OssConstant.CLOUD_SERVICE);
 | 
			
		||||
 | 
			
		||||
            //创建AWS基于 CRT 的 S3 客户端
 | 
			
		||||
            this.client = S3AsyncClient.crtBuilder()
 | 
			
		||||
@@ -94,15 +94,15 @@ public class OssClient {
 | 
			
		||||
                .targetThroughputInGbps(20.0)
 | 
			
		||||
                .minimumPartSizeInBytes(10 * 1025 * 1024L)
 | 
			
		||||
                .checksumValidationEnabled(false)
 | 
			
		||||
                .forcePathStyle(pathStyle)
 | 
			
		||||
                .forcePathStyle(isStyle)
 | 
			
		||||
                .build();
 | 
			
		||||
 | 
			
		||||
            //AWS基于 CRT 的 S3 AsyncClient 实例用作 S3 传输管理器的底层客户端
 | 
			
		||||
            this.transferManager = S3TransferManager.builder().s3Client(this.client).build();
 | 
			
		||||
 | 
			
		||||
            // 检查是否连接到 MinIO
 | 
			
		||||
            // 创建 S3 配置对象
 | 
			
		||||
            S3Configuration config = S3Configuration.builder().chunkedEncodingEnabled(false)
 | 
			
		||||
                .pathStyleAccessEnabled(pathStyle).build();
 | 
			
		||||
                .pathStyleAccessEnabled(isStyle).build();
 | 
			
		||||
 | 
			
		||||
            // 创建 预签名 URL 的生成器 实例,用于生成 S3 预签名 URL
 | 
			
		||||
            this.presigner = S3Presigner.builder()
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user