From 1c1680bed76487db836a2571f19c23d01d5fb0fb Mon Sep 17 00:00:00 2001 From: mediabot-pt <295750538+mediabot-pt@users.noreply.github.com> Date: Thu, 2 Jul 2026 13:35:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AF=BC=E5=87=BA=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=93=8D=E5=BA=94=E6=8B=A6=E6=88=AA=E5=99=A8?= =?UTF-8?q?=E9=97=AE=E9=A2=98(api=E8=BF=94=E5=9B=9Eresponse.data=E9=9D=9Er?= =?UTF-8?q?esponse)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/views/AccessResults.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/web/src/views/AccessResults.vue b/web/src/views/AccessResults.vue index 6b3f8cb..e1dac3f 100644 --- a/web/src/views/AccessResults.vue +++ b/web/src/views/AccessResults.vue @@ -76,9 +76,10 @@ const sites = ref([]) const exportScripts = async () => { exporting.value = true try { + // api 响应拦截器返回 response.data,所以 r 直接就是 blob const r = await api.get('/admin/scripts/export', { responseType: 'blob' }) const a = document.createElement('a') - a.href = URL.createObjectURL(new Blob([r.data])) + a.href = URL.createObjectURL(new Blob([r])) a.download = 'scripts.zip'; a.click(); URL.revokeObjectURL(a.href) } catch { ElMessage.error('导出失败') } finally { exporting.value = false } @@ -89,7 +90,7 @@ const importScripts = async (file) => { 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) + ' 失败')) + ElMessage.success('导入完成: ' + ((r.ok || 0) + ' 成功, ' + (r.fail || 0) + ' 失败')) fetchAll() } catch { ElMessage.error('导入失败') } finally { importing.value = false }