Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵月辉
/
fastgpt-migrated
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
ea45d2dc
authored
Jul 20, 2026
by
Xianquan
Committed by
GitHub
Jul 20, 2026
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: respect configured chat upload limit (#7336)
parent
959ecfba
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
6 deletions
+49
-6
pro
+1
-1
projects/app/src/components/core/app/FileSelect.tsx
+6
-5
projects/app/src/components/core/app/fileSelectConfig.ts
+12
-0
projects/app/test/components/core/app/fileSelectConfig.test.ts
+30
-0
No files found.
pro
@
0da7a5a7
Subproject commit
ec193812c120166b135f4ce6acaa44d9c853ac8f
Subproject commit
0da7a5a71abe3ea1fa27e4ea078a987734fd2ce8
projects/app/src/components/core/app/FileSelect.tsx
View file @
ea45d2dc
...
@@ -26,6 +26,7 @@ import MyTag from '@fastgpt/web/components/common/Tag/index';
...
@@ -26,6 +26,7 @@ import MyTag from '@fastgpt/web/components/common/Tag/index';
import
{
defaultAppSelectFileConfig
}
from
'@fastgpt/global/core/app/constants'
;
import
{
defaultAppSelectFileConfig
}
from
'@fastgpt/global/core/app/constants'
;
import
InputSlider
from
'@fastgpt/web/components/common/MySlider/InputSlider'
;
import
InputSlider
from
'@fastgpt/web/components/common/MySlider/InputSlider'
;
import
{
FileTypeSelectorPanel
}
from
'@fastgpt/web/components/core/app/FileTypeSelector'
;
import
{
FileTypeSelectorPanel
}
from
'@fastgpt/web/components/core/app/FileTypeSelector'
;
import
{
resolveFileSelectConfigMaxFiles
}
from
'./fileSelectConfig'
;
const
FileSelect
=
({
const
FileSelect
=
({
forbidVision
=
false
,
forbidVision
=
false
,
...
@@ -42,11 +43,11 @@ const FileSelect = ({
...
@@ -42,11 +43,11 @@ const FileSelect = ({
const
{
teamPlanStatus
}
=
useUserStore
();
const
{
teamPlanStatus
}
=
useUserStore
();
const
{
isOpen
,
onOpen
,
onClose
}
=
useDisclosure
();
const
{
isOpen
,
onOpen
,
onClose
}
=
useDisclosure
();
//
文件数量限制:团队套餐 || 系统配置 || 默认值(这里是指对话中,最多上传多少文件)
//
对话可配置的文件数量不能超过团队套餐;未配置套餐时沿用系统上传上限。
const
maxSelectFiles
=
Math
.
min
(
const
maxSelectFiles
=
resolveFileSelectConfigMaxFiles
({
teamPlan
Status
?.
standard
?.
maxUploadFileCount
||
feConfigs
.
uploadFileMaxAm
ount
,
teamPlan
MaxFiles
:
teamPlanStatus
?.
standard
?.
maxUploadFileC
ount
,
50
systemMaxFiles
:
feConfigs
.
uploadFileMaxAmount
);
}
);
const
[
localValue
,
setLocalValue
]
=
useState
(
value
);
const
[
localValue
,
setLocalValue
]
=
useState
(
value
);
...
...
projects/app/src/components/core/app/fileSelectConfig.ts
0 → 100644
View file @
ea45d2dc
/**
* 解析工作流对话可配置的最大文件数。
* 团队套餐是更严格的业务上限;套餐未配置该字段时,才回退到系统上传数量配置。
* 该函数单独导出用于覆盖无套餐和套餐限制的回归测试。
*/
export
const
resolveFileSelectConfigMaxFiles
=
({
teamPlanMaxFiles
,
systemMaxFiles
}:
{
teamPlanMaxFiles
?:
number
;
systemMaxFiles
:
number
;
})
=>
teamPlanMaxFiles
??
systemMaxFiles
;
projects/app/test/components/core/app/fileSelectConfig.test.ts
0 → 100644
View file @
ea45d2dc
import
{
describe
,
expect
,
it
}
from
'vitest'
;
import
{
resolveFileSelectConfigMaxFiles
}
from
'@/components/core/app/fileSelectConfig'
;
describe
(
'resolveFileSelectConfigMaxFiles'
,
()
=>
{
it
(
'uses the system upload limit when the team plan has no file limit'
,
()
=>
{
expect
(
resolveFileSelectConfigMaxFiles
({
systemMaxFiles
:
100
})
).
toBe
(
100
);
});
it
(
'uses the team plan limit when it is configured'
,
()
=>
{
expect
(
resolveFileSelectConfigMaxFiles
({
teamPlanMaxFiles
:
20
,
systemMaxFiles
:
100
})
).
toBe
(
20
);
});
it
(
'does not replace an explicit zero limit with the system limit'
,
()
=>
{
expect
(
resolveFileSelectConfigMaxFiles
({
teamPlanMaxFiles
:
0
,
systemMaxFiles
:
100
})
).
toBe
(
0
);
});
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment