无密码账号验证码登录后强制设置密码

- 登录/注册/me 接口返回 has_password 标志
- 新增 POST /api/auth/set-password:登录态直接设密码(无需邮箱验证码)
- 前端:has_password=false 的用户登录后弹出不可关闭的设置密码层,设置成功才能进入应用
- 测试 +4(47/47):标志返回、端点鉴权、改密生效、旧密码失效
This commit is contained in:
2026-10-29 19:38:14 +08:00
parent 1d4001898c
commit f0aa26a60d
5 changed files with 154 additions and 2 deletions
+15
View File
@@ -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; }