|
@@ -214,12 +214,19 @@ export default {
|
|
|
return true
|
|
|
}
|
|
|
const isType = this.fileType.indexOf(file.type) >= 0 && file.type != ''
|
|
|
- if (!isType) {
|
|
|
+ // 文件格式限制为.xls、.xlsx时,上传.csv文件的type为application/vnd.ms-excel,与.xls一致,无法限制,因此更改为:
|
|
|
+ if (!isType || file.name.indexOf('.csv')>=0) {
|
|
|
if (tip != 0) {
|
|
|
this.$message.error('请上传正确的格式!')
|
|
|
}
|
|
|
- return isType
|
|
|
+ return isType && !(file.name.indexOf('.csv')>=0)
|
|
|
}
|
|
|
+ // if (!isType) {
|
|
|
+ // if (tip != 0) {
|
|
|
+ // this.$message.error('请上传正确的格式!')
|
|
|
+ // }
|
|
|
+ // return isType
|
|
|
+ // }
|
|
|
|
|
|
// 文件大小
|
|
|
const isLt2M = file.size / 1024 / 1024 < this.fileSize
|