1 parent
7cd24a2958
commit
80bcde5fc2
2 files changed
+13
-1
No files matched your search
@@ -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
|
||||
}
|
||||
|
||||
@@ -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 })
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user