perf: 导入PPTX文件异常捕获

This commit is contained in:
zxc 2025-03-15 16:33:27 +08:00
parent ae1ea94edc
commit 6461b1a059

View File

@ -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