校验上传表格的文件类型是否符合
export const checkExcelType = (file: any) =>{ let fileName = file.target.value.split('.'); if(fileName[fileName.length -1]=== "xlsx" || fileName[fileName.length -1]=== "xls" || fileName[fileName.length -1]=== "xltx" || fileName[fileName.length -1]=== "xlt" || fileName[fileName.length -1]=== "xlsm" || fileName[fileName.length -1]=== "xlsb" || fileName[fileName.length -1]=== "xltm" || fileName[fileName.length -1]=== "csv" ){ return true }else{ alert('请上传正确格式的表格') return false; } };