Refactor site import/export feature with improved toast notifications

Co-authored-by: jxxghp <jxxghp@live.cn>
This commit is contained in:
Cursor Agent
2025-08-22 23:12:01 +00:00
parent afc7c81028
commit 671cf8d588
5 changed files with 8 additions and 310 deletions

View File

@@ -11,10 +11,14 @@ import { useDisplay } from 'vuetify'
import { useDynamicButton } from '@/composables/useDynamicButton'
import { useI18n } from 'vue-i18n'
import { usePWA } from '@/composables/usePWA'
import { useToast } from 'vue-toastification'
// 国际化
const { t } = useI18n()
// 提示框
const $toast = useToast()
// 路由
const route = useRoute()
@@ -260,15 +264,9 @@ async function exportSites() {
URL.revokeObjectURL(url)
// 显示成功提示
const { t } = useI18n()
const { useToast } = await import('vue-toastification')
const $toast = useToast()
$toast.success(t('site.messages.exportSuccess'))
} catch (error) {
console.error('Export sites failed:', error)
const { t } = useI18n()
const { useToast } = await import('vue-toastification')
const $toast = useToast()
$toast.error(t('site.messages.exportFailed'))
}
}