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
426eceac
authored
Apr 17, 2023
by
archer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: inviterId无效
parent
1ee527ce
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 additions
and
17 deletions
+1
-17
src/pages/api/user/register.ts
+1
-1
src/service/models/user.ts
+0
-16
No files found.
src/pages/api/user/register.ts
View file @
426eceac
...
...
@@ -47,7 +47,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
const
response
=
await
User
.
create
({
username
:
phone
,
password
,
inviterId
inviterId
:
inviterId
?
inviterId
:
undefined
});
// 根据 id 获取用户信息
...
...
src/service/models/user.ts
View file @
426eceac
...
...
@@ -3,9 +3,6 @@ import { hashPassword } from '@/service/utils/tools';
import
{
PRICE_SCALE
}
from
'@/constants/common'
;
import
{
UserModelSchema
}
from
'@/types/mongoSchema'
;
const
UserSchema
=
new
Schema
({
email
:
{
type
:
String
},
username
:
{
// 可以是手机/邮箱,新的验证都只用手机
type
:
String
,
...
...
@@ -45,19 +42,6 @@ const UserSchema = new Schema({
type
:
String
,
default
:
''
},
accounts
:
[
{
type
:
{
type
:
String
,
required
:
true
,
enum
:
[
'openai'
]
// 定义允许的type
},
value
:
{
type
:
String
,
required
:
true
}
}
],
createTime
:
{
type
:
Date
,
default
:
()
=>
new
Date
()
...
...
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