besscroft / PicImpact

PicImpact 是一个摄影师专用的摄影作品展示网站,基于 Next.js 开发。

Home Page:https://pic.besscroft.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

自建minio作为s3 存储的问题

super5xy opened this issue · comments

问题1
自建minio的URL是{域名}/{桶名字}而不是{桶名字}.{域名}的格式,需要把S3Client把forcePathStyle设置为true,能否加一个配置项控制这个属性,同时返回的图片全路径也变成{域名}/{桶名字}

s3Client = new S3Client({
region: region,
endpoint: endpoint.includes('https://') ? endpoint : https://${endpoint},
credentials: {
accessKeyId: accesskeyId,
secretAccessKey: accesskeySecret,
},
forcePathStyle: true,
});

问题2 存储路径多了个"/"
image
image

非常感谢您提交了 issues,我们很高兴能够与您一起合作解决这个问题。我们将尽快进行审核,并会在 24 小时内回复您。在此期间,如有任何问题,请随时联系我们。再次感谢您的贡献!

@super5xy 感谢您的反馈,我会抽空调试解决。

第一个问题已解决,第二个问题还存在,选择首页的时候还是多了一个/,没有走新加的判断 image

我擦,我漏了个条件,等俺抽空改一下。