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
83d569df
authored
Aug 02, 2023
by
archer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perf: auth event model
parent
58d94e10
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
client/src/pages/api/openapi/kb/pushData.ts
+12
-0
No files found.
client/src/pages/api/openapi/kb/pushData.ts
View file @
83d569df
...
@@ -35,6 +35,18 @@ export default withNextCors(async function handler(req: NextApiRequest, res: Nex
...
@@ -35,6 +35,18 @@ export default withNextCors(async function handler(req: NextApiRequest, res: Nex
if
(
!
kbId
||
!
Array
.
isArray
(
data
)
||
!
model
)
{
if
(
!
kbId
||
!
Array
.
isArray
(
data
)
||
!
model
)
{
throw
new
Error
(
'缺少参数'
);
throw
new
Error
(
'缺少参数'
);
}
}
// auth model
if
(
mode
===
TrainingModeEnum
.
qa
&&
!
global
.
qaModels
.
find
((
item
)
=>
item
.
model
===
model
))
{
throw
new
Error
(
'不支持的 QA 拆分模型'
);
}
if
(
mode
===
TrainingModeEnum
.
index
&&
!
global
.
vectorModels
.
find
((
item
)
=>
item
.
model
===
model
)
)
{
throw
new
Error
(
'不支持的向量生成模型'
);
}
await
connectToDatabase
();
await
connectToDatabase
();
// 凭证校验
// 凭证校验
...
...
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