diff --git a/src/modules/fm-manager/proxy/http-proxy.ts b/src/modules/fm-manager/proxy/http-proxy.ts index 55521b4..ba939f5 100644 --- a/src/modules/fm-manager/proxy/http-proxy.ts +++ b/src/modules/fm-manager/proxy/http-proxy.ts @@ -46,6 +46,7 @@ export async function minioProxy( const fileUrl = opts.proxyUrl; const { createNotFoundPage, isDownload = false } = opts; const objectName = fileUrl.replace(minioResources + '/', ''); + console.log('proxy url objectName', objectName) try { const stat = await oss.statObject(objectName); if (stat?.size === 0) { @@ -124,6 +125,7 @@ export const httpProxy = async ( const params = _u.searchParams; const isDownload = params.get('download') === 'true'; if (proxyUrl.startsWith(minioResources)) { + console.log('isMinio', proxyUrl) const isOk = await minioProxy(req, res, { ...opts, isDownload }); if (!isOk) { userApp.clearCacheData(); diff --git a/src/modules/s3.ts b/src/modules/s3.ts index d84efd2..1405095 100644 --- a/src/modules/s3.ts +++ b/src/modules/s3.ts @@ -5,6 +5,7 @@ const config = useConfig(); export const bucketName = config.S3_BUCKET_NAME || 'resources'; +const isMinio = config.S3_ENDPOINT?.includes?.('9000'); export const s3Client = new S3Client({ credentials: { accessKeyId: config.S3_ACCESS_KEY_ID || '', @@ -13,7 +14,7 @@ export const s3Client = new S3Client({ region: config.S3_REGION, endpoint: config.S3_ENDPOINT, // minio配置 - forcePathStyle: true, + forcePathStyle: isMinio ? true : undefined, }); // 判断 bucketName 是否存在,不存在则创建