Feature: support short url now

This commit is contained in:
萌萌哒赫萝
2023-04-17 17:26:49 +08:00
parent ef917ce26e
commit d55458197a
20 changed files with 151 additions and 75 deletions
+31
View File
@@ -102,6 +102,24 @@
:title="customLink"
/>
</el-radio-group>
<el-radio-group
v-model="useShortUrl"
size="small"
@change="handleUseShortUrlChange"
>
<el-radio-button
:label="true"
style="border-radius: 5px"
>
{{ $T('UPLOAD_SHORT_URL') }}
</el-radio-button>
<el-radio-button
:label="false"
style="border-radius: 5px"
>
{{ $T('UPLOAD_NORMAL_URL') }}
</el-radio-button>
</el-radio-group>
</div>
<div class="el-col-8">
<div class="paste-style__text">
@@ -386,6 +404,7 @@ import { PICBEDS_PAGE } from '@/router/config'
const $router = useRouter()
const imageProcessDialogVisible = ref(false)
const useShortUrl = ref(false)
const waterMarkPositionMap = new Map([
['north', $T('UPLOAD_PAGE_IMAGE_PROCESS_POSITION_TOP')],
@@ -488,6 +507,7 @@ onBeforeMount(() => {
showError.value = true
}
})
getUseShortUrl()
getPasteStyle()
getDefaultPicBed()
ipcRenderer.on('syncPicBed', () => {
@@ -605,6 +625,17 @@ async function getPasteStyle () {
customLink.value = await getConfig('settings.customLink') || '![$fileName]($url)'
}
async function getUseShortUrl () {
useShortUrl.value = await getConfig('settings.useShortUrl') || false
}
async function handleUseShortUrlChange () {
console.log(useShortUrl.value)
saveConfig({
'settings.useShortUrl': useShortUrl.value
})
}
function handlePasteStyleChange (val: string | number | boolean) {
saveConfig({
'settings.pasteStyle': val