fix: inviterId无效

This commit is contained in:
archer
2023-04-17 00:31:08 +08:00
parent 1ee527ceb8
commit 426eceac22
2 changed files with 1 additions and 17 deletions

View File

@@ -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 获取用户信息

View File

@@ -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()