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
e289c4ec
authored
Mar 26, 2023
by
archer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: ts数据
parent
1cbcc624
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
3 deletions
+11
-3
src/pages/api/data/getDataItems.ts
+1
-2
src/pages/api/timer/updateTraining.ts
+2
-1
src/pages/api/user/register.ts
+4
-0
src/pages/api/user/updatePasswordByCode.ts
+4
-0
No files found.
src/pages/api/data/getDataItems.ts
View file @
e289c4ec
...
@@ -35,8 +35,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
...
@@ -35,8 +35,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
pageSize
,
pageSize
,
data
:
dataItems
,
data
:
dataItems
,
total
:
await
DataItem
.
countDocuments
({
total
:
await
DataItem
.
countDocuments
({
dataId
,
dataId
status
:
0
})
})
}
}
});
});
...
...
src/pages/api/timer/updateTraining.ts
View file @
e289c4ec
...
@@ -9,6 +9,7 @@ import { getUserOpenaiKey } from '@/service/utils/tools';
...
@@ -9,6 +9,7 @@ import { getUserOpenaiKey } from '@/service/utils/tools';
import
{
OpenAiTuneStatusEnum
}
from
'@/service/constants/training'
;
import
{
OpenAiTuneStatusEnum
}
from
'@/service/constants/training'
;
import
{
sendTrainSucceed
}
from
'@/service/utils/sendEmail'
;
import
{
sendTrainSucceed
}
from
'@/service/utils/sendEmail'
;
import
{
httpsAgent
}
from
'@/service/utils/tools'
;
import
{
httpsAgent
}
from
'@/service/utils/tools'
;
import
{
ModelPopulate
}
from
'@/types/mongoSchema'
;
export
default
async
function
handler
(
req
:
NextApiRequest
,
res
:
NextApiResponse
)
{
export
default
async
function
handler
(
req
:
NextApiRequest
,
res
:
NextApiResponse
)
{
if
(
req
.
headers
.
auth
!==
'archer'
)
{
if
(
req
.
headers
.
auth
!==
'archer'
)
{
...
@@ -31,7 +32,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
...
@@ -31,7 +32,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
// 删除训练文件
// 删除训练文件
openai
.
deleteFile
(
data
.
training_files
[
0
].
id
,
{
httpsAgent
});
openai
.
deleteFile
(
data
.
training_files
[
0
].
id
,
{
httpsAgent
});
const
model
=
await
Model
.
findById
(
item
.
modelId
).
populate
({
const
model
=
await
Model
.
findById
<
ModelPopulate
>
(
item
.
modelId
).
populate
({
path
:
'userId'
,
path
:
'userId'
,
options
:
{
options
:
{
strictPopulate
:
false
strictPopulate
:
false
...
...
src/pages/api/user/register.ts
View file @
e289c4ec
...
@@ -46,6 +46,10 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
...
@@ -46,6 +46,10 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
// 根据 id 获取用户信息
// 根据 id 获取用户信息
const
user
=
await
User
.
findById
(
response
.
_id
);
const
user
=
await
User
.
findById
(
response
.
_id
);
if
(
!
user
)
{
throw
new
Error
(
'获取用户信息异常'
);
}
jsonRes
(
res
,
{
jsonRes
(
res
,
{
data
:
{
data
:
{
token
:
generateToken
(
user
.
_id
),
token
:
generateToken
(
user
.
_id
),
...
...
src/pages/api/user/updatePasswordByCode.ts
View file @
e289c4ec
...
@@ -44,6 +44,10 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
...
@@ -44,6 +44,10 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
email
email
});
});
if
(
!
user
)
{
throw
new
Error
(
'获取用户信息异常'
);
}
jsonRes
(
res
,
{
jsonRes
(
res
,
{
data
:
{
data
:
{
token
:
generateToken
(
user
.
_id
),
token
:
generateToken
(
user
.
_id
),
...
...
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