From f0aa26a60dcfff6a3386899908832cd55e9faa7f Mon Sep 17 00:00:00 2001 From: soehi <811446351@qq.com> Date: Thu, 29 Oct 2026 19:38:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0=E5=AF=86=E7=A0=81=E8=B4=A6=E5=8F=B7?= =?UTF-8?q?=E9=AA=8C=E8=AF=81=E7=A0=81=E7=99=BB=E5=BD=95=E5=90=8E=E5=BC=BA?= =?UTF-8?q?=E5=88=B6=E8=AE=BE=E7=BD=AE=E5=AF=86=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 登录/注册/me 接口返回 has_password 标志 - 新增 POST /api/auth/set-password:登录态直接设密码(无需邮箱验证码) - 前端:has_password=false 的用户登录后弹出不可关闭的设置密码层,设置成功才能进入应用 - 测试 +4(47/47):标志返回、端点鉴权、改密生效、旧密码失效 --- dist/assets/styles.css | 15 +++++++++ dist/index.html | 14 +++++++- dist/js/app.js | 39 +++++++++++++++++++++++ server/main.py | 26 ++++++++++++++- tests/test_force_password.py | 62 ++++++++++++++++++++++++++++++++++++ 5 files changed, 154 insertions(+), 2 deletions(-) create mode 100644 tests/test_force_password.py diff --git a/dist/assets/styles.css b/dist/assets/styles.css index e53c014..8b9f369 100644 --- a/dist/assets/styles.css +++ b/dist/assets/styles.css @@ -414,3 +414,18 @@ form input, form select, form textarea, .form-card input, .form-card select { wi .tag.pending { background: #fef3c7; color: #92400e; } .review-add { display: flex; align-items: center; gap: 8px; margin: 12px 0; } .review-add input { flex: 1; margin-top: 0; } + +/* 强制设置密码层 */ +#force-password-overlay { + position: fixed; inset: 0; z-index: 90; + background: rgba(15, 23, 42, .55); + display: flex; align-items: center; justify-content: center; +} +#force-password-overlay.hidden { display: none; } +#force-password-form { + width: min(400px, calc(100vw - 32px)); + background: #fff; border-radius: 14px; padding: 26px 24px; + box-shadow: 0 10px 40px rgba(0, 0, 0, .25); +} +#force-password-form h3 { margin: 0 0 6px; } +#force-password-form p { margin: 0 0 14px; } diff --git a/dist/index.html b/dist/index.html index cd9ff53..086d75a 100644 --- a/dist/index.html +++ b/dist/index.html @@ -202,9 +202,21 @@
+ +