From 3c7a3d80f89f7338995e76aa8c8b22bd893ced51 Mon Sep 17 00:00:00 2001 From: mediabot-pt <295750538+mediabot-pt@users.noreply.github.com> Date: Thu, 2 Jul 2026 13:05:11 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=80=82=E9=85=8D=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E9=A1=B5=E5=8A=A0=E5=AF=BC=E5=87=BA/?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E8=84=9A=E6=9C=AC=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/views/AccessResults.vue | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/web/src/views/AccessResults.vue b/web/src/views/AccessResults.vue index c551017..6b3f8cb 100644 --- a/web/src/views/AccessResults.vue +++ b/web/src/views/AccessResults.vue @@ -2,8 +2,12 @@

适配验证

-
+
刷新 + 导出脚本 + + 导入脚本 +
@@ -66,9 +70,31 @@ import api from '../api' import { Refresh } from '@element-plus/icons-vue' -const loading = ref(false) +const loading = ref(false), exporting = ref(false), importing = ref(false) const sites = ref([]) +const exportScripts = async () => { + exporting.value = true + try { + const r = await api.get('/admin/scripts/export', { responseType: 'blob' }) + const a = document.createElement('a') + a.href = URL.createObjectURL(new Blob([r.data])) + a.download = 'scripts.zip'; a.click(); URL.revokeObjectURL(a.href) + } catch { ElMessage.error('导出失败') } + finally { exporting.value = false } +} + +const importScripts = async (file) => { + importing.value = true + try { + const fd = new FormData(); fd.append('file', file.raw) + const r = await api.post('/admin/scripts/import', fd) + ElMessage.success('导入完成: ' + ((r.data?.ok || 0) + ' 成功, ' + (r.data?.fail || 0) + ' 失败')) + fetchAll() + } catch { ElMessage.error('导入失败') } + finally { importing.value = false } +} + const friendlyTime = (t) => { if (!t) return null const d = new Date(t), now = new Date()