From 80bcde5fc2c96c92cef30d8712a207575e0f8dd8 Mon Sep 17 00:00:00 2001 From: smail Date: Sat, 5 Sep 2026 14:06:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=91=E5=88=B6=E9=85=8D=E7=BD=AE=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E9=87=8D=E5=A4=8D=E9=94=99=E8=AF=AF=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fe/src/views/components/ConfigSettings/ConfigSettings.js | 7 ++++++- .../views/components/SecuritySettings/SecuritySettings.js | 7 +++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/fe/src/views/components/ConfigSettings/ConfigSettings.js b/fe/src/views/components/ConfigSettings/ConfigSettings.js index 893ee4e..c9f31fa 100644 --- a/fe/src/views/components/ConfigSettings/ConfigSettings.js +++ b/fe/src/views/components/ConfigSettings/ConfigSettings.js @@ -59,6 +59,7 @@ export function usePage() { const migrationToken = ref('') const migrationRecord = ref(null) const restartPreview = ref(null) + let initializationErrorShown = false const canWrite = computed(() => globalStatus.hasCapability('config.write_global')) const canRollback = computed(() => globalStatus.hasCapability('config.rollback')) @@ -271,10 +272,14 @@ export function usePage() { } const loadAll = async () => { loading.value = true + initializationErrorShown = false try { await Promise.all([loadStatus(), loadSection(), loadBackups(), loadAudit()]) } catch (error) { - ElMessage.error(error.message || '配置管理数据读取失败') + if (!initializationErrorShown) { + initializationErrorShown = true + ElMessage.error(error.message || '配置管理数据读取失败') + } } finally { loading.value = false } diff --git a/fe/src/views/components/SecuritySettings/SecuritySettings.js b/fe/src/views/components/SecuritySettings/SecuritySettings.js index 9488547..7c9dc9f 100644 --- a/fe/src/views/components/SecuritySettings/SecuritySettings.js +++ b/fe/src/views/components/SecuritySettings/SecuritySettings.js @@ -49,6 +49,8 @@ export function usePage() { const generatedCodes = ref([]) const externalEmails = ref([]) const externalLoading = ref(false) + let lastNotificationKey = '' + let lastNotificationAt = 0 const bindForm = reactive({ email: '', type: 'backup', challengeId: '', bindingId: 0, code: '' }) const ruleForm = reactive({ current_pwd: '', new_pwd: '', new_pwd2: '' }) @@ -59,6 +61,11 @@ export function usePage() { }) const notify = (message, type = 'error') => { + const notificationKey = `${type}:${String(message || '').trim()}` + const now = Date.now() + if (notificationKey === lastNotificationKey && now - lastNotificationAt < 1500) return + lastNotificationKey = notificationKey + lastNotificationAt = now ElNotification({ title: type === 'success' ? '操作成功' : '操作失败', message, type }) }