fix: inviterId无效
This commit is contained in:
parent
1ee527ceb8
commit
426eceac22
@ -47,7 +47,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
|
|||||||
const response = await User.create({
|
const response = await User.create({
|
||||||
username: phone,
|
username: phone,
|
||||||
password,
|
password,
|
||||||
inviterId
|
inviterId: inviterId ? inviterId : undefined
|
||||||
});
|
});
|
||||||
|
|
||||||
// 根据 id 获取用户信息
|
// 根据 id 获取用户信息
|
||||||
|
|||||||
@ -3,9 +3,6 @@ import { hashPassword } from '@/service/utils/tools';
|
|||||||
import { PRICE_SCALE } from '@/constants/common';
|
import { PRICE_SCALE } from '@/constants/common';
|
||||||
import { UserModelSchema } from '@/types/mongoSchema';
|
import { UserModelSchema } from '@/types/mongoSchema';
|
||||||
const UserSchema = new Schema({
|
const UserSchema = new Schema({
|
||||||
email: {
|
|
||||||
type: String
|
|
||||||
},
|
|
||||||
username: {
|
username: {
|
||||||
// 可以是手机/邮箱,新的验证都只用手机
|
// 可以是手机/邮箱,新的验证都只用手机
|
||||||
type: String,
|
type: String,
|
||||||
@ -45,19 +42,6 @@ const UserSchema = new Schema({
|
|||||||
type: String,
|
type: String,
|
||||||
default: ''
|
default: ''
|
||||||
},
|
},
|
||||||
accounts: [
|
|
||||||
{
|
|
||||||
type: {
|
|
||||||
type: String,
|
|
||||||
required: true,
|
|
||||||
enum: ['openai'] // 定义允许的type
|
|
||||||
},
|
|
||||||
value: {
|
|
||||||
type: String,
|
|
||||||
required: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
createTime: {
|
createTime: {
|
||||||
type: Date,
|
type: Date,
|
||||||
default: () => new Date()
|
default: () => new Date()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user