v4.1 管理员邮箱绑定与SMTP找回密码

1. users 表新增 email 列,管理员添加/编辑支持绑定邮箱,修改密码页支持自助绑定
2. 新增 SMTP 邮件发送工具与配置(FRONTEND_URL/SMTP_* 等)
3. 新增忘记密码/重置密码公开接口与页面:一次性令牌、30分钟有效、请求限流、重置后强制重新登录
4. 登录与 /api/auth/me 返回邮箱并同步 PHP Session
5. 版本升级至4.1(sql/upgrades/v4.1.sql)
This commit is contained in:
canglan committed 2026-09-17 20:49:15 +08:00
1 parent 3588b4c28c
commit 058dee9dc4
31 files changed
+762 -34

No files matched your search

+10 -1
View File
@@ -34,7 +34,7 @@ include __DIR__ . '/../includes/header.php';
<div class="table-wrapper">
<table class="table">
<thead>
<tr><th>用户名</th><th>姓名</th><th>权限组</th><th>加减分上限</th><th>状态</th><th>操作</th></tr>
<tr><th>用户名</th><th>姓名</th><th>绑定邮箱</th><th>权限组</th><th>加减分上限</th><th>状态</th><th>操作</th></tr>
</thead>
<tbody id="adminList"></tbody>
</table>
@@ -72,6 +72,11 @@ include __DIR__ . '/../includes/header.php';
<label>姓名</label>
<input type="text" id="adminRealName" required placeholder="真实姓名">
</div>
<div class="form-group">
<label>绑定邮箱</label>
<input type="email" id="adminEmail" maxlength="100" placeholder="选填,用于找回密码">
<small>绑定后可通过登录页"忘记密码"重置密码</small>
</div>
<div class="form-group">
<label>密码</label>
<input type="text" id="adminPassword" placeholder="留空则自动生成">
@@ -108,6 +113,10 @@ include __DIR__ . '/../includes/header.php';
<label>姓名</label>
<input type="text" id="editAdminRealName" required>
</div>
<div class="form-group">
<label>绑定邮箱</label>
<input type="email" id="editAdminEmail" maxlength="100" placeholder="留空解除绑定">
</div>
<div class="form-group">
<label>权限组</label>
<select id="editAdminGroupId" required>