diff --git a/src/renderer/manage/pages/bucketPage.vue b/src/renderer/manage/pages/bucketPage.vue index 8e78fde..ab59ff6 100644 --- a/src/renderer/manage/pages/bucketPage.vue +++ b/src/renderer/manage/pages/bucketPage.vue @@ -21,7 +21,7 @@ style="width: 200px;" :persistent="false" teleported - @change="handleChangeCustomUrl" + @change="handleChangeCustomUrlInput" > ('picBed') const currentConfig = currentConfigs[configMap.alias] const currentTransformedConfig = JSON.parse(currentConfig.transformedConfig ?? '{}') @@ -2174,7 +2165,7 @@ async function initCustomDomainList () { currentCustomDomain.value = `https://${configMap.bucketName}.s3.amazonaws.com` } } - handleChangeCustomUrl() + await handleChangeCustomUrl() } else if (currentPicBedName.value === 'webdavplist') { const currentConfigs = await getConfig('picBed') const currentConfig = currentConfigs[configMap.alias] @@ -2188,17 +2179,20 @@ async function initCustomDomainList () { } currentCustomDomain.value = endpoint } - handleChangeCustomUrl() + await handleChangeCustomUrl() } else if (currentPicBedName.value === 'local' || currentPicBedName.value === 'sftp') { const currentConfigs = await getConfig('picBed') const currentConfig = currentConfigs[configMap.alias] const currentTransformedConfig = JSON.parse(currentConfig.transformedConfig ?? '{}') if (currentTransformedConfig[configMap.bucketName] && currentTransformedConfig[configMap.bucketName]?.customUrl) { currentCustomDomain.value = currentTransformedConfig[configMap.bucketName].customUrl ?? '' + if (manageStore.config.settings.isForceCustomUrlHttps && currentCustomDomain.value.startsWith('http://')) { + currentCustomDomain.value = currentCustomDomain.value.replace('http://', 'https://') + } } else { currentCustomDomain.value = '' } - handleChangeCustomUrl() + await handleChangeCustomUrl() } } @@ -2232,6 +2226,7 @@ async function resetParam (force: boolean = false) { fileSortSizeReverse.value = false fileSortTimeReverse.value = false if (!isAutoRefresh.value && !force && !paging.value) { + console.log('use cache') const cachedData = await searchExistFileList() if (cachedData.length > 0) { currentPageFilesInfo.push(...cachedData[0].value.fullList) @@ -2283,7 +2278,7 @@ watch(route, async (newRoute) => { const parsedConfigMap = JSON.parse(queryConfigMap) Object.assign(configMap, parsedConfigMap) await initCustomDomainList() - await resetParam(false) + await resetParam(true) isShowLoadingPage.value = false } }) @@ -3683,7 +3678,7 @@ onBeforeMount(async () => { await manageStore.refreshConfig() isShowLoadingPage.value = true await initCustomDomainList() - await resetParam(false) + await resetParam(true) isShowLoadingPage.value = false document.addEventListener('keydown', handleDetectShiftKey) document.addEventListener('keyup', handleDetectShiftKey) diff --git a/src/renderer/manage/pages/manageSetting.vue b/src/renderer/manage/pages/manageSetting.vue index 261ea88..30bca98 100644 --- a/src/renderer/manage/pages/manageSetting.vue +++ b/src/renderer/manage/pages/manageSetting.vue @@ -618,7 +618,7 @@ async function initData () { form.isShowThumbnail = config.settings.isShowThumbnail ?? false form.isShowList = config.settings.isShowList ?? false form.isIgnoreCase = config.settings.isIgnoreCase ?? false - form.isForceCustomUrlHttps = config.settings.isForceCustomUrlHttps ?? true + form.isForceCustomUrlHttps = config.settings.isForceCustomUrlHttps ?? false form.isEncodeUrl = config.settings.isEncodeUrl ?? false form.isUploadKeepDirStructure = config.settings.isUploadKeepDirStructure ?? true form.isDownloadFileKeepDirStructure = config.settings.isDownloadKeepDirStructure ?? false