From d642ab42be9d56ba02b35e3f45c04448073b6a3e Mon Sep 17 00:00:00 2001 From: thsrite Date: Sun, 8 Oct 2023 12:13:21 +0800 Subject: [PATCH] =?UTF-8?q?feat=20=E8=87=AA=E5=AE=9A=E4=B9=89=E5=8D=A0?= =?UTF-8?q?=E4=BD=8D=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/setting/AccountSettingWords.vue | 57 +++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/src/views/setting/AccountSettingWords.vue b/src/views/setting/AccountSettingWords.vue index 710029f2..cc2d6df0 100644 --- a/src/views/setting/AccountSettingWords.vue +++ b/src/views/setting/AccountSettingWords.vue @@ -11,6 +11,9 @@ const customIdentifiers = ref('') // 自定义制作组 const customReleaseGroups = ref('') +// 自定义占位符 +const customization = ref('') + // 文件整理屏蔽词 const transferExcludeWords = ref('') @@ -42,6 +45,20 @@ async function queryCustomReleaseGroups() { } } +// 查询已设置的自定义占位符 +async function queryCustomization() { + try { + const result: { [key: string]: any } = await api.get( + 'system/setting/Customization', + ) + + customization.value = result.data?.value.join('\n') + } + catch (error) { + console.log(error) + } +} + // 查询已设置的屏蔽词 async function queryTransferExcludeWords() { try { @@ -94,6 +111,25 @@ async function saveCustomReleaseGroups() { } } +// 保存自定义占位符 +async function saveCustomization() { + try { + // 用户名密码 + const result: { [key: string]: any } = await api.post( + 'system/setting/Customization', + customization.value.split('\n'), + ) + + if (result.success) + $toast.success('自定义占位符保存成功') + else + $toast.error('自定义占位符保存失败!') + } + catch (error) { + console.log(error) + } +} + // 保存文件整理屏蔽词 async function saveTransferExcludeWords() { try { @@ -116,6 +152,7 @@ async function saveTransferExcludeWords() { onMounted(() => { queryCustomIdentifiers() queryCustomReleaseGroups() + queryCustomization() queryTransferExcludeWords() }) @@ -166,6 +203,26 @@ onMounted(() => { + + + 添加自定义占位符识别正则,重命名格式中添加{{customization}}使用。 + + + + + + 保存 + + + + 目录名或文件名中包含屏蔽词时不进行整理。