feat: 手机验证码作为用户凭证

This commit is contained in:
archer
2023-04-16 19:53:50 +08:00
parent 36dad6df33
commit faf722fa15
20 changed files with 375 additions and 167 deletions

View File

@@ -2,7 +2,7 @@ import { Schema, model, models, Model } from 'mongoose';
import { AuthCodeSchema as AuthCodeType } from '@/types/mongoSchema';
const AuthCodeSchema = new Schema({
email: {
username: {
type: String,
required: true
},

View File

@@ -3,7 +3,8 @@ import { hashPassword } from '@/service/utils/tools';
import { PRICE_SCALE } from '@/constants/common';
import { UserModelSchema } from '@/types/mongoSchema';
const UserSchema = new Schema({
email: {
username: {
// 可以是手机/邮箱,新的验证都只用手机
type: String,
required: true,
unique: true // 唯一