From 23de8bc86a3090ef1a0557536cdea4f71055e840 Mon Sep 17 00:00:00 2001 From: Yuzhiran Dev Date: Sun, 12 Jul 2026 16:02:57 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=82=AE=E7=AE=B1=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E7=A0=81=E6=B3=A8=E5=86=8C+=E7=99=BB=E5=BD=95=E5=8D=8F?= =?UTF-8?q?=E8=AE=AE=E5=8B=BE=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 后端: VerificationCode模型+send-code API+register增加verifyCode校验 - 前端: 注册表单增加验证码输入框+60s倒计时获取按钮 - 前端: 登录表单增加用户协议/隐私政策勾选 - 前端: 登录按钮增加disabled状态(未勾选时不可点击) - 后端: nodemailer邮件发送工具(可配置SMTP,未配置时返回devCode) --- client/src/pages.json | 3 +- client/src/pages/agreement/agreement.vue | 154 ++++++++ client/src/pages/login/login.vue | 436 ++++++++++++----------- client/src/stores/user.js | 8 +- client/src/utils/api.js | 8 +- server/package-lock.json | 18 +- server/package.json | 10 +- server/src/models/User.js | 20 +- server/src/models/VerificationCode.js | 15 + server/src/models/index.js | 4 +- server/src/routes/auth.js | 135 ++++++- server/src/utils/mail.js | 68 ++++ 12 files changed, 626 insertions(+), 253 deletions(-) create mode 100644 client/src/pages/agreement/agreement.vue create mode 100644 server/src/models/VerificationCode.js create mode 100644 server/src/utils/mail.js diff --git a/client/src/pages.json b/client/src/pages.json index 535f5d9..8260491 100644 --- a/client/src/pages.json +++ b/client/src/pages.json @@ -15,7 +15,8 @@ {"path": "pages/dimension/dimension", "style": {"navigationBarTitleText": "", "navigationStyle": "custom"}}, {"path": "pages/chat/chat", "style": {"navigationBarTitleText": "AI 问答", "navigationStyle": "custom"}}, {"path": "pages/trend/trend", "style": {"navigationBarTitleText": "AI 趋势", "navigationStyle": "custom"}}, - {"path": "pages/profile/profile", "style": {"navigationBarTitleText": "我的", "navigationStyle": "custom"}} + {"path": "pages/profile/profile", "style": {"navigationBarTitleText": "我的", "navigationStyle": "custom"}}, + {"path": "pages/agreement/agreement", "style": {"navigationBarTitleText": "协议", "navigationStyle": "custom"}} ], "globalStyle": { "navigationBarTextStyle": "black", diff --git a/client/src/pages/agreement/agreement.vue b/client/src/pages/agreement/agreement.vue new file mode 100644 index 0000000..32f655f --- /dev/null +++ b/client/src/pages/agreement/agreement.vue @@ -0,0 +1,154 @@ + + + + + \ No newline at end of file diff --git a/client/src/pages/login/login.vue b/client/src/pages/login/login.vue index d5875c8..172ac93 100644 --- a/client/src/pages/login/login.vue +++ b/client/src/pages/login/login.vue @@ -1,12 +1,10 @@