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); }