File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed
ruoyi-fastapi-frontend/src/components Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -104,10 +104,15 @@ function handleBeforeUpload(file) {
104104 const fileExt = fileName[fileName .length - 1 ];
105105 const isTypeOk = props .fileType .indexOf (fileExt) >= 0 ;
106106 if (! isTypeOk) {
107- proxy .$modal .msgError (` 文件格式不正确, 请上传${ props .fileType .join (" /" )} 格式文件!` );
107+ proxy .$modal .msgError (` 文件格式不正确, 请上传${ props .fileType .join (" /" )} 格式文件!` );
108108 return false ;
109109 }
110110 }
111+ // 校检文件名是否包含特殊字符
112+ if (file .name .includes (' ,' )) {
113+ proxy .$modal .msgError (' 文件名不正确,不能包含英文逗号!' );
114+ return false ;
115+ }
111116 // 校检文件大小
112117 if (props .fileSize ) {
113118 const isLt = file .size / 1024 / 1024 < props .fileSize ;
Original file line number Diff line number Diff line change @@ -125,9 +125,11 @@ function handleBeforeUpload(file) {
125125 isImg = file .type .indexOf (" image" ) > - 1 ;
126126 }
127127 if (! isImg) {
128- proxy .$modal .msgError (
129- ` 文件格式不正确, 请上传${ props .fileType .join (" /" )} 图片格式文件!`
130- );
128+ proxy .$modal .msgError (` 文件格式不正确,请上传${ props .fileType .join (" /" )} 图片格式文件!` );
129+ return false ;
130+ }
131+ if (file .name .includes (' ,' )) {
132+ proxy .$modal .msgError (' 文件名不正确,不能包含英文逗号!' );
131133 return false ;
132134 }
133135 if (props .fileSize ) {
You can’t perform that action at this time.
0 commit comments