From 16fb63aa79aaef9aa415c7b73b1dad7dc444a0b1 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Tue, 15 Sep 2020 20:46:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=93=8D=E4=BD=9C=E8=A7=84=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- safesite/templates/operproceadd.html | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/safesite/templates/operproceadd.html b/safesite/templates/operproceadd.html index 967f3f59..56fcf6c3 100644 --- a/safesite/templates/operproceadd.html +++ b/safesite/templates/operproceadd.html @@ -251,20 +251,12 @@ return false; }; - var filetypes = [".txt", ".ppt", ".doc", ".pdf", ".pptx", "docx", ".ppt"];//判断上传文件格式类型 + var filetypes = [".txt", ".ppt", ".doc", ".pdf", ".pptx", ".docx", ".ppt"];//判断上传文件格式类型 var filepath = target.value; if (filepath) { var isnext = false; var fileend = filepath.substring(filepath.indexOf(".")); - if (filetypes && filetypes.length > 0) { - for (var i = 0; i < filetypes.length; i++) { - if (filetypes[i] == fileend) { - isnext = true; - break; - } - } - } - if (!isnext) { + if (filetypes.indexOf(fileend)==-1) { alert("不接受此文件类型!"); target.value = ""; $("#videoName").text('文件格式不支持,请重新选择上传文件!');