diff --git a/src/renderer/manage/pages/bucketPage.vue b/src/renderer/manage/pages/bucketPage.vue index 7c40f76..3f312db 100644 --- a/src/renderer/manage/pages/bucketPage.vue +++ b/src/renderer/manage/pages/bucketPage.vue @@ -2094,13 +2094,18 @@ async function initCustomDomainList () { } else { if (manageStore.config.picBed[configMap.alias].endpoint) { const endpoint = manageStore.config.picBed[configMap.alias].endpoint + const s3ForcePathStyle = manageStore.config.picBed[configMap.alias].s3ForcePathStyle let url if (/^https?:\/\//.test(endpoint)) { url = new URL(endpoint) } 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 { currentCustomDomain.value = `https://${configMap.bucketName}.s3.amazonaws.com` }