feat: 邮箱验证码注册+登录协议勾选

- 后端: VerificationCode模型+send-code API+register增加verifyCode校验
- 前端: 注册表单增加验证码输入框+60s倒计时获取按钮
- 前端: 登录表单增加用户协议/隐私政策勾选
- 前端: 登录按钮增加disabled状态(未勾选时不可点击)
- 后端: nodemailer邮件发送工具(可配置SMTP,未配置时返回devCode)
This commit is contained in:
Yuzhiran Dev
2026-07-12 16:02:57 +08:00
parent dd5c1bc7ac
commit 23de8bc86a
12 changed files with 626 additions and 253 deletions
+13 -7
View File
@@ -53,13 +53,19 @@ const UserSchema = new Schema({
},
// H5环境用户名密码登录
username: {
type: String,
unique: true,
sparse: true,
index: true
},
password: {
username: {
type: String,
unique: true,
sparse: true,
index: true
},
email: {
type: String,
unique: true,
sparse: true,
index: true
},
password: {
type: String,
select: false
},