From 6461b1a059a9539c0e21a59257ac463c1fcda20b Mon Sep 17 00:00:00 2001 From: zxc <1171051090@qq.com> Date: Sat, 15 Mar 2025 16:33:27 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E5=AF=BC=E5=85=A5PPTX=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=BC=82=E5=B8=B8=E6=8D=95=E8=8E=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/useImport.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/hooks/useImport.ts b/src/hooks/useImport.ts index df8f91d8..68252d1d 100644 --- a/src/hooks/useImport.ts +++ b/src/hooks/useImport.ts @@ -149,7 +149,15 @@ export default () => { const reader = new FileReader() reader.onload = async e => { - const json = await parse(e.target!.result as ArrayBuffer) + let json = null + try { + json = await parse(e.target!.result as ArrayBuffer) + } + catch { + exporting.value = false + message.error('无法正确读取 / 解析该文件') + return + } const ratio = 96 / 72 const width = json.size.width