🐛 Fix: fix custom domain error of minio

This commit is contained in:
萌萌哒赫萝 2023-08-28 23:47:00 -07:00
parent 95faa5b247
commit 0c8ea832aa

View File

@ -2094,13 +2094,18 @@ async function initCustomDomainList () {
} else { } else {
if (manageStore.config.picBed[configMap.alias].endpoint) { if (manageStore.config.picBed[configMap.alias].endpoint) {
const endpoint = manageStore.config.picBed[configMap.alias].endpoint const endpoint = manageStore.config.picBed[configMap.alias].endpoint
const s3ForcePathStyle = manageStore.config.picBed[configMap.alias].s3ForcePathStyle
let url let url
if (/^https?:\/\//.test(endpoint)) { if (/^https?:\/\//.test(endpoint)) {
url = new URL(endpoint) url = new URL(endpoint)
} else { } else {
url = new URL(manageStore.config.picBed[configMap.alias].sslEnabled ? 'https://' + endpoint : 'http://' + endpoint) url = new URL(manageStore.config.picBed[configMap.alias].sslEnabled ? `https://${endpoint}` : `http://${endpoint}`)
}
if (s3ForcePathStyle) {
currentCustomDomain.value = `${url.protocol}//${url.hostname}${url.port ? ':' + url.port : ''}/${configMap.bucketName}`
} else {
currentCustomDomain.value = `${url.protocol}//${configMap.bucketName}.${url.hostname}${url.port ? ':' + url.port : ''}`
} }
currentCustomDomain.value = `${url.protocol}//${configMap.bucketName}.${url.hostname}`
} else { } else {
currentCustomDomain.value = `https://${configMap.bucketName}.s3.amazonaws.com` currentCustomDomain.value = `https://${configMap.bucketName}.s3.amazonaws.com`
} }