From fdad2eee7260db61e411d69bb97be128360a1cde Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Wed, 20 Apr 2022 17:14:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8B=96=E6=8B=BD=E4=B8=8A=E4=BC=A0=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=A4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Upload/Index.js | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/forge/Upload/Index.js b/src/forge/Upload/Index.js index 20324211..7184d253 100644 --- a/src/forge/Upload/Index.js +++ b/src/forge/Upload/Index.js @@ -61,13 +61,10 @@ class Index extends Component { handleChange = (info) => { const { changeIsComplete } = this.props; changeIsComplete && changeIsComplete(true); - const file = info.file; - if(file && file.type){ - if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') { - let fileList = info.fileList; - this.setState({ fileList: appendFileSizeToUploadFileAll(fileList) }); - this.fileIdList(fileList); - } + if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') { + let fileList = info.fileList; + this.setState({ fileList: appendFileSizeToUploadFileAll(fileList) }); + this.fileIdList(fileList); } } @@ -80,10 +77,18 @@ class Index extends Component { } beforeUpload = (file) => { - console.log(file); if(file && !file.type){ - this.props.showNotification(`暂不支持此格式文件的上传!`); - return; + let name = file.name; + const filestr = ['.rar','.iso',".flv", ".rmvb", ".mmf", ".ape"]; + let flag = false; + for(var i= 0;i