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 }) }