From f3ae835304e82a644e564ed68c224138ee5e3cb2 Mon Sep 17 00:00:00 2001 From: ypshidifu Date: Thu, 17 Sep 2026 20:50:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=89=8D=E7=AB=AF:=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E6=A0=BC=E5=BC=8F=E6=A0=A1=E9=AA=8C=EF=BC=8C?= =?UTF-8?q?=E6=8B=92=E6=94=B6=E9=9D=9Encm/kgm/kgma/vpr=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/index.html | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/templates/index.html b/templates/index.html index b020597..10b33ba 100644 --- a/templates/index.html +++ b/templates/index.html @@ -109,6 +109,8 @@ let files = []; + const SUPPORTED_EXTENSIONS = ['.ncm', '.kgm', '.kgma', '.vpr']; + // 点击上传区域选择文件 dropZone.addEventListener('click', () => fileInput.click()); @@ -139,6 +141,11 @@ function handleFiles(fileListObj) { for (const f of fileListObj) { + const ext = f.name.slice(f.name.lastIndexOf('.')).toLowerCase(); + if (!SUPPORTED_EXTENSIONS.includes(ext)) { + alert('不支持的文件格式: ' + f.name + '\\n仅支持: .ncm / .kgm / .kgma / .vpr'); + continue; + } if (files.some(existing => existing.name === f.name)) continue; files.push(f); }