修改bug

This commit is contained in:
张运江 2025-02-13 17:37:54 +08:00
parent 1594d736d7
commit 87b52c0f76
3 changed files with 11 additions and 8 deletions

View File

@ -261,7 +261,9 @@
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('文件名称包含非法字符,请重新上传!')
return
}

View File

@ -109,13 +109,7 @@ export default {
}
})
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 : '';
console.log(this.repaymentObj, '---this.repaymentObj', this.fileList)
},
handleClose() {
this.$emit('update:eventDialog', null)

View File

@ -35,7 +35,13 @@ function specialChar(value) {
return /^[^~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~@#¥%……&*()——\-+={}|《》?:“”【】、;‘',。、]+$/
.test(value)
}
/**
* 验证特殊字符格式
*/
function specialCharNew(value) {
return /[ \n\t&V:?"#*|&<>%'+]/
.test(value)
}
/**
* 替换特殊字符格式
*/
@ -222,5 +228,6 @@ export default {
specialCharRep,
postalCode,
specialChar,
specialCharNew,
judgeCard
}