Commit 2a963f72 authored by mzx's avatar mzx Committed by jiaxu.yan

feat(imageUpload图片公共上传): 上传特殊字符限制

parent a5b495e9
......@@ -130,10 +130,12 @@ export default {
// 上传前loading加载
handleBeforeUpload(file) {
if (file.name) {
const regex = /[\s~`!@#$%^&*()\-_=+[\]{}|;:'",<>/?]/
// const regex = /[\s~`!@#$%^&*()\-_=+[\]{}|;:'",<>/?]/
const regex = /[~`!@#$%^&*=[\]{}|;:'",<>/?]/
const result = regex.test(file.name)
if (result === true) {
this.fileList = []
// this.$refs.imageUpload.clearFiles()
this.$modal.msgError('文件名称不正确,请上传不包含特殊字符名称的图片')
} else if (result === false) {
let isImg = false
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment