:fix: 新建/修改文件或文件夹时,检测特殊字符的问题
This commit is contained in:
parent
e03c1e5a01
commit
428c7d9652
@ -369,9 +369,9 @@
|
|||||||
if(newFileName === row.name){
|
if(newFileName === row.name){
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
if(/[\/\\"<>\?\*]/gi.test(newFileName)){
|
if (/[\[\]\/\\"<>\?\*]/gi.test(newFileName)){
|
||||||
this.$message({
|
this.$message({
|
||||||
message: '文件名不能包含以下字字符:<,>,|,*,?,,/',
|
message: '文件名不能包含以下字符:<,>,|,*,?,,/,[,]',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
});
|
});
|
||||||
return false
|
return false
|
||||||
|
|||||||
@ -1745,9 +1745,9 @@ export default {
|
|||||||
// 新建文件夹
|
// 新建文件夹
|
||||||
newFolderNameClick() {
|
newFolderNameClick() {
|
||||||
if (this.newFolderName) {
|
if (this.newFolderName) {
|
||||||
if (/[\/\\"<>\?\*]/gi.test(this.newFolderName)) {
|
if (/[\[\]\/\\"<>\?\*]/gi.test(this.newFolderName)) {
|
||||||
this.$message({
|
this.$message({
|
||||||
message: '文件名不能包含以下字字符:<,>,|,*,?,,/',
|
message: '文件名不能包含以下字符:<,>,|,*,?,,/,[,]',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
@ -1795,9 +1795,9 @@ export default {
|
|||||||
// 新建文本文件
|
// 新建文本文件
|
||||||
createTextFile(newFileName) {
|
createTextFile(newFileName) {
|
||||||
if (newFileName) {
|
if (newFileName) {
|
||||||
if (/[\/\\"<>\?\*]/gi.test(newFileName)) {
|
if (/[\[\]\/\\"<>\?\*]/gi.test(newFileName)) {
|
||||||
this.$message({
|
this.$message({
|
||||||
message: '文件名不能包含以下字字符:<,>,|,*,?,,/',
|
message: '文件名不能包含以下字符:<,>,|,*,?,,/,[,]',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
@ -2323,9 +2323,9 @@ export default {
|
|||||||
newFileName = newFileName.replace(/[\r\n]/g, "");
|
newFileName = newFileName.replace(/[\r\n]/g, "");
|
||||||
console.log('newFileName', newFileName)
|
console.log('newFileName', newFileName)
|
||||||
if (newFileName) {
|
if (newFileName) {
|
||||||
if (/[\/\\"<>\?\*]/gi.test(newFileName)) {
|
if (/[\[\]\/\\"<>\?\*]/gi.test(newFileName)) {
|
||||||
this.$message({
|
this.$message({
|
||||||
message: '文件名不能包含以下字字符:<,>,|,*,?,,/',
|
message: '文件名不能包含以下字符:<,>,|,*,?,,/,[,]',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user