From 38e55d962ce7cfdcead3f958b4019dc7b851947e Mon Sep 17 00:00:00 2001 From: xiaoqidun Date: Thu, 9 Jul 2026 13:07:59 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=89=8D=E7=AB=AF=E7=95=8C=E9=9D=A2):=20?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=89=8D=E7=AB=AF=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/webui/index.html | 2 +- assets/webui/ofdgo.js | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/assets/webui/index.html b/assets/webui/index.html index 7ed90d0..89c18d0 100644 --- a/assets/webui/index.html +++ b/assets/webui/index.html @@ -9,7 +9,7 @@
- +
diff --git a/assets/webui/ofdgo.js b/assets/webui/ofdgo.js index 8c97168..71e15de 100644 --- a/assets/webui/ofdgo.js +++ b/assets/webui/ofdgo.js @@ -361,6 +361,11 @@ async function openSelectedOFD() { if (!file) { return; } + if (!isOFDFile(file)) { + el.ofdInput.value = ""; + showError(new Error("请选择 .ofd 文件"), !state.doc); + return; + } state.wasmRecoveries = 0; setBusy(true, "正在读取 OFD", 10, STATUS.opening); try { @@ -373,6 +378,10 @@ async function openSelectedOFD() { } } +function isOFDFile(file) { + return /\.ofd$/i.test(file.name || ""); +} + async function openSelectedFonts() { const files = Array.from(el.fontInput.files || []); if (!files.length) {