From 428c7d96529b286a095ab0b0d637fcbd99786588 Mon Sep 17 00:00:00 2001 From: jmal Date: Mon, 8 Aug 2022 17:30:20 +0800 Subject: [PATCH] =?UTF-8?q?:fix:=20=E6=96=B0=E5=BB=BA/=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E6=88=96=E6=96=87=E4=BB=B6=E5=A4=B9=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E6=A3=80=E6=B5=8B=E7=89=B9=E6=AE=8A=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/FancyTree/index.vue | 4 ++-- src/components/ShowFile/ShowFile.vue | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/FancyTree/index.vue b/src/components/FancyTree/index.vue index 542e924..626c70f 100644 --- a/src/components/FancyTree/index.vue +++ b/src/components/FancyTree/index.vue @@ -369,9 +369,9 @@ if(newFileName === row.name){ return true } - if(/[\/\\"<>\?\*]/gi.test(newFileName)){ + if (/[\[\]\/\\"<>\?\*]/gi.test(newFileName)){ this.$message({ - message: '文件名不能包含以下字字符:<,>,|,*,?,,/', + message: '文件名不能包含以下字符:<,>,|,*,?,,/,[,]', type: 'warning' }); return false diff --git a/src/components/ShowFile/ShowFile.vue b/src/components/ShowFile/ShowFile.vue index 764a1ad..f878b1b 100644 --- a/src/components/ShowFile/ShowFile.vue +++ b/src/components/ShowFile/ShowFile.vue @@ -1745,9 +1745,9 @@ export default { // 新建文件夹 newFolderNameClick() { if (this.newFolderName) { - if (/[\/\\"<>\?\*]/gi.test(this.newFolderName)) { + if (/[\[\]\/\\"<>\?\*]/gi.test(this.newFolderName)) { this.$message({ - message: '文件名不能包含以下字字符:<,>,|,*,?,,/', + message: '文件名不能包含以下字符:<,>,|,*,?,,/,[,]', type: 'warning' }); return; @@ -1795,9 +1795,9 @@ export default { // 新建文本文件 createTextFile(newFileName) { if (newFileName) { - if (/[\/\\"<>\?\*]/gi.test(newFileName)) { + if (/[\[\]\/\\"<>\?\*]/gi.test(newFileName)) { this.$message({ - message: '文件名不能包含以下字字符:<,>,|,*,?,,/', + message: '文件名不能包含以下字符:<,>,|,*,?,,/,[,]', type: 'warning' }) return @@ -2323,9 +2323,9 @@ export default { newFileName = newFileName.replace(/[\r\n]/g, ""); console.log('newFileName', newFileName) if (newFileName) { - if (/[\/\\"<>\?\*]/gi.test(newFileName)) { + if (/[\[\]\/\\"<>\?\*]/gi.test(newFileName)) { this.$message({ - message: '文件名不能包含以下字字符:<,>,|,*,?,,/', + message: '文件名不能包含以下字符:<,>,|,*,?,,/,[,]', type: 'warning' }); return;