修改bug
This commit is contained in:
parent
1594d736d7
commit
87b52c0f76
@ -261,7 +261,9 @@
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
// 文件名称不能包含特殊字符
|
// 文件名称不能包含特殊字符
|
||||||
if (!this.$verify.specialChar(param.file.name)) {
|
let filename = param.file.name
|
||||||
|
let name = filename.substring(0, filename.lastIndexOf("."))
|
||||||
|
if (this.$verify.specialCharNew(name)) {
|
||||||
this.$message.error('文件名称包含非法字符,请重新上传!')
|
this.$message.error('文件名称包含非法字符,请重新上传!')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@ -109,13 +109,7 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.repaymentObj.name = this.fileList.length?this.fileList[0].objectName : '';
|
this.repaymentObj.name = this.fileList.length?this.fileList[0].objectName : '';
|
||||||
if (!this.$verify.specialChar(this.repaymentObj.name)) {
|
|
||||||
this.$message.error('文件名称包含非法字符,请重新上传!')
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
this.repaymentObj.url = this.fileList.length?this.fileList[0].fileName : '';
|
this.repaymentObj.url = this.fileList.length?this.fileList[0].fileName : '';
|
||||||
|
|
||||||
console.log(this.repaymentObj, '---this.repaymentObj', this.fileList)
|
|
||||||
},
|
},
|
||||||
handleClose() {
|
handleClose() {
|
||||||
this.$emit('update:eventDialog', null)
|
this.$emit('update:eventDialog', null)
|
||||||
|
|||||||
@ -35,7 +35,13 @@ function specialChar(value) {
|
|||||||
return /^[^~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘',。、]+$/
|
return /^[^~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘',。、]+$/
|
||||||
.test(value)
|
.test(value)
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 验证特殊字符格式
|
||||||
|
*/
|
||||||
|
function specialCharNew(value) {
|
||||||
|
return /[ \n\t&V:?"#*|&<>%'+]/
|
||||||
|
.test(value)
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 替换特殊字符格式
|
* 替换特殊字符格式
|
||||||
*/
|
*/
|
||||||
@ -222,5 +228,6 @@ export default {
|
|||||||
specialCharRep,
|
specialCharRep,
|
||||||
postalCode,
|
postalCode,
|
||||||
specialChar,
|
specialChar,
|
||||||
|
specialCharNew,
|
||||||
judgeCard
|
judgeCard
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user