diff --git a/src/forge/Upload/Index.js b/src/forge/Upload/Index.js index 7184d253..f979fe7f 100644 --- a/src/forge/Upload/Index.js +++ b/src/forge/Upload/Index.js @@ -61,6 +61,11 @@ class Index extends Component { handleChange = (info) => { const { changeIsComplete } = this.props; changeIsComplete && changeIsComplete(true); + const file = info.file; + if(file && !file.type){ + let flag = this.checkFile(file.name); + if(!flag) return; + } if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') { let fileList = info.fileList; this.setState({ fileList: appendFileSizeToUploadFileAll(fileList) }); @@ -76,15 +81,22 @@ class Index extends Component { array && this.props.load && this.props.load(array); } + checkFile=(str)=>{ + const filestr = ['.rar','.iso',".flv", ".rmvb", ".mmf", ".ape", ".vsdx", ".msi",".md"]; + let flag = false; + for(var i= 0;i { if(file && !file.type){ - let name = file.name; - const filestr = ['.rar','.iso',".flv", ".rmvb", ".mmf", ".ape"]; - let flag = false; - for(var i= 0;i