File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
ui/src/components/ai-chat/component/chat-input-operate Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -1195,6 +1195,17 @@ async function saveUrl() {
11951195 MsgWarning (t (' chat.uploadFile.invalidUrl' ))
11961196 return
11971197 }
1198+ const {maxFiles, fileLimit} = props .applicationDetails .file_upload_setting
1199+ const file_limit_once =
1200+ uploadImageList .value .length +
1201+ uploadDocumentList .value .length +
1202+ uploadAudioList .value .length +
1203+ uploadVideoList .value .length +
1204+ uploadOtherList .value .length
1205+ if (file_limit_once >= maxFiles ) {
1206+ MsgWarning (t (' chat.uploadFile.limitMessage1' ) + maxFiles + t (' chat.uploadFile.limitMessage2' ))
1207+ return
1208+ }
11981209 // 允许的 MIME 类型
11991210 const allowedTypes: Record <string , string []> = {
12001211 image: imageExtensions
@@ -1257,8 +1268,6 @@ async function saveUrl() {
12571268 return ;
12581269 }
12591270
1260- // 大小校验
1261- const {fileLimit} = props .applicationDetails .file_upload_setting ;
12621271 if (fileSize > fileLimit * 1024 * 1024 ) {
12631272 MsgWarning (url + ' ' + t (' chat.uploadFile.sizeLimit' ) + fileLimit + ' MB' )
12641273 return ;
You can’t perform that action at this time.
0 commit comments