修复旧哈希账号首次登录改密被要求原密码的问题

1. 登录时自动升级旧密码哈希改为只更新 password_hash,不再误清 need_change_password 标记
2. need_change_password 语义明确为"密码待修改":创建/重置置 1,用户改密成功清 0,登录自动升级哈希不影响
3. 首次登录弹窗与文档文案由"首次登录"改为"密码待修改(首次使用/被重置后)"
This commit is contained in:
canglan committed 2026-11-02 13:00:39 +08:00
1 parent f624219cba
commit 928c86bd5a
5 files changed
+31 -12

No files matched your search

+3 -2
View File
@@ -109,12 +109,13 @@ $page_title = $page_title ?? '首页';
</script>
<?php endif; ?>
<?php if ($user_type === 'admin'): ?>
<!-- 首次登录/重置后:设置新密码(无需原密码) -->
<!-- 密码待修改(初始密码/被重置后):设置新密码(无需原密码) -->
<div id="initPasswordModal" class="modal" style="display:none;">
<div class="modal-content" style="max-width:420px;">
<div class="modal-header">
<h3>首次登录:请设置新密码</h3>
<h3>请设置新密码</h3>
</div>
<p style="font-size:13px;color:var(--color-text-muted);margin:0 0 12px;">首次使用或密码被管理员重置后,需要先设置新密码(无需输入原密码)</p>
<div class="form-group">
<label>新密码</label>
<input type="password" id="initNewPassword" autocomplete="new-password">