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

+4 -1
View File
@@ -23,6 +23,7 @@
const realName = document.getElementById('adminRealName').value.trim();
const password = document.getElementById('adminPassword').value;
const groupId = parseInt(document.getElementById('adminGroupId').value);
const email = document.getElementById('adminEmail').value.trim();
if (!username || !realName || !groupId) {
showToast('请填写完整信息', 'warning');
@@ -33,7 +34,8 @@
username: username,
real_name: realName,
password: password || undefined,
group_id: groupId
group_id: groupId,
email: email || undefined
});
if (res && res.success) {
@@ -49,6 +51,7 @@
document.getElementById('adminRealName').value = '';
document.getElementById('adminPassword').value = '';
document.getElementById('adminGroupId').value = '';
document.getElementById('adminEmail').value = '';
loadAdmins();
} else {
showToast(res?.message || '添加失败', 'error');