File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
ruoyi-fastapi-frontend/src/components Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -119,10 +119,15 @@ export default {
119119 const fileExt = fileName[fileName .length - 1 ];
120120 const isTypeOk = this .fileType .indexOf (fileExt) >= 0 ;
121121 if (! isTypeOk) {
122- this .$modal .msgError (` 文件格式不正确, 请上传${ this .fileType .join (" /" )} 格式文件!` );
122+ this .$modal .msgError (` 文件格式不正确, 请上传${ this .fileType .join (" /" )} 格式文件!` );
123123 return false ;
124124 }
125125 }
126+ // 校检文件名是否包含特殊字符
127+ if (file .name .includes (' ,' )) {
128+ this .$modal .msgError (' 文件名不正确,不能包含英文逗号!' );
129+ return false ;
130+ }
126131 // 校检文件大小
127132 if (this .fileSize ) {
128133 const isLt = file .size / 1024 / 1024 < this .fileSize ;
Original file line number Diff line number Diff line change @@ -136,7 +136,11 @@ export default {
136136 }
137137
138138 if (! isImg) {
139- this .$modal .msgError (` 文件格式不正确, 请上传${ this .fileType .join (" /" )} 图片格式文件!` );
139+ this .$modal .msgError (` 文件格式不正确,请上传${ this .fileType .join (" /" )} 图片格式文件!` );
140+ return false ;
141+ }
142+ if (file .name .includes (' ,' )) {
143+ this .$modal .msgError (' 文件名不正确,不能包含英文逗号!' );
140144 return false ;
141145 }
142146 if (this .fileSize ) {
You can’t perform that action at this time.
0 commit comments