diff --git a/src/renderer/manage/pages/bucketPage.vue b/src/renderer/manage/pages/bucketPage.vue
index 47c0fac..788f440 100644
--- a/src/renderer/manage/pages/bucketPage.vue
+++ b/src/renderer/manage/pages/bucketPage.vue
@@ -581,7 +581,7 @@ https://www.baidu.com/img/bd_logo1.png"
size="20"
style="cursor: pointer;"
color="#409EFF"
- @click="copyToClipboard(formatLink(item.url, item.fileName, manageStore.config.settings.pasteForma ?? '$markdown', manageStore.config.settings.customPasteFormat ?? '$url'))"
+ @click="copyToClipboard(formatLink(item.url, item.fileName, manageStore.config.settings.pasteFormat ?? '$markdown', manageStore.config.settings.customPasteFormat ?? '$url'))"
>
@@ -1506,7 +1506,7 @@ const isShowVideoFileDialog = ref(false)
const videoFileUrl = ref('')
const videoPlayerHeaders = ref({})
const showFileStyle = ref<'list' | 'grid'>('grid')
-const isUploadKeepDirStructure = ref(manageStore.config.settings.isUploadKeepDirStructure ?? true)
+const isUploadKeepDirStructure = computed(() => manageStore.config.settings.isUploadKeepDirStructure ?? true)
const isShowBatchRenameDialog = ref(false)
const batchRenameMatch = ref('')
const batchRenameReplace = ref('')
@@ -3489,7 +3489,7 @@ const columns: Column[] = [
size="20"
style="cursor: pointer;"
color="#409EFF"
- onClick={() => copyToClipboard(formatLink(item.url, item.fileName, manageStore.config.settings.pasteForma ?? '$markdown', manageStore.config.settings.customPasteFormat ?? '$url'))}
+ onClick={() => copyToClipboard(formatLink(item.url, item.fileName, manageStore.config.settings.pasteFormat ?? '$markdown', manageStore.config.settings.customPasteFormat ?? '$url'))}
>
@@ -3629,6 +3629,7 @@ const columns: Column[] = [
]
onBeforeMount(async () => {
+ console.log('onBeforeMount')
await manageStore.refreshConfig()
showLoadingPage.value = true
await initCustomUrlList()
diff --git a/src/renderer/manage/pages/manageSetting.vue b/src/renderer/manage/pages/manageSetting.vue
index abe724e..2377d29 100644
--- a/src/renderer/manage/pages/manageSetting.vue
+++ b/src/renderer/manage/pages/manageSetting.vue
@@ -19,7 +19,7 @@
style="width: 100%;"
>
{{ $T('MANAGE_SETTING_CHOOSE_COPY_FORMAT_MARKDOWN') }}
-
+
{{ $T('MANAGE_SETTING_CHOOSE_COPY_FORMAT_MARKDOWN_WITH_LINK') }}
@@ -573,7 +573,7 @@ async function initData () {
form.customRename = config.settings.customRename ?? false
customRenameFormat.value = config.settings.customRenameFormat ?? '{filename}'
customPasteFormat.value = config.settings.customPasteFormat ?? '$url'
- form.pasteFormat = config.settings.pasteForma ?? 'markdown'
+ pasteFormat.value = config.settings.pasteFormat ?? 'markdown'
downloadDir.value = config.settings.downloadDir ?? ''
form.isAutoRefresh = config.settings.isAutoRefresh ?? false
form.isShowThumbnail = config.settings.isShowThumbnail ?? false
diff --git a/src/renderer/manage/utils/common.ts b/src/renderer/manage/utils/common.ts
index 0c14efa..ce70827 100644
--- a/src/renderer/manage/utils/common.ts
+++ b/src/renderer/manage/utils/common.ts
@@ -50,24 +50,25 @@ export function renameFile (typeMap : IStringKeyMap, oldName: string): string {
}
export function formatLink (url: string, fileName: string, type: string, format?: string) : string {
+ const encodedUrl = encodeURI(url)
switch (type) {
case 'markdown':
- return `![${fileName}](${url})`
+ return `![${fileName}](${encodedUrl})`
case 'html':
- return ``
+ return ``
case 'bbcode':
- return `[img]${url}[/img]`
+ return `[img]${encodedUrl}[/img]`
case 'url':
- return url
+ return encodedUrl
case 'markdown-with-link':
- return `[![${fileName}](${url})](${url})`
+ return `[![${fileName}](${encodedUrl})](${encodedUrl})`
case 'custom':
if (format && (format.includes('$url') || format.includes('$fileName'))) {
- return format.replace(/\$url/g, url).replace(/\$fileName/g, fileName)
+ return format.replace(/\$url/g, encodedUrl).replace(/\$fileName/g, fileName)
}
- return url
+ return encodedUrl
default:
- return url
+ return encodedUrl
}
}
diff --git a/src/renderer/pages/Upload.vue b/src/renderer/pages/Upload.vue
index 5afc610..00063e3 100644
--- a/src/renderer/pages/Upload.vue
+++ b/src/renderer/pages/Upload.vue
@@ -17,7 +17,7 @@
id="upload-view-title"
@click="handlePicBedNameClick(picBedName, picBedConfigName)"
>
- {{ $T('PICTURE_UPLOAD') }} - {{ picBedName }} - {{ picBedConfigName }}
+ {{ picBedName }} - {{ picBedConfigName }}