Files
ClassManager/frontend/forgot_password.php
T
canglan ed3189096d 权限组全自定义、月度分独立、绑定邮箱免密与样式统一
1. 权限组:去掉锁定/预置限制,所有组可编辑/删除/分配;管理员新增/编辑可选任意组;管理员列表不再显示锁定徽标
2. 个人查询:月度分独立计算(当月净得分,与基础分无关),总分=基础分+加分-减分
3. 绑定邮箱:发送验证码与确认绑定不再需要密码(解绑仍需密码)
4. 权限组编辑UI:权限项按 学生/操行分/教务/系统管理 分区,支持全选/清空,上限两行布局,弹窗加宽
5. 样式统一:颜色变量化(硬编码色值清零)、check-grid/check-item 统一复选框网格、cell-wrap、subject-status 全局化、success-msg
6. 旧库升级期兼容保留(登录/权限降级、待升级提示)
7. 文档同步更新
2026-09-18 09:56:39 +08:00

94 lines
3.6 KiB
PHP

<?php
/**
* 班级操行分管理系统 - 忘记密码
*
* 开发者: Canglan
* 联系方式: admin@sea-studio.top
* 版权归属: Sea Network Technology Studio
* 许可证: MIT License
*
* 版权所有 © Sea Network Technology Studio
*/
require_once __DIR__ . '/config.php';
?>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<title><?php echo SITE_NAME; ?> - 忘记密码</title>
<link rel="stylesheet" href="/assets/css/style.css">
</head>
<body>
<div class="login-container">
<div class="login-header">
<h1><?php echo SITE_NAME; ?></h1>
<p>管理员找回密码</p>
</div>
<form id="forgotForm" class="login-form">
<div class="form-group">
<label>管理员账号</label>
<input type="text" id="username" name="username" required autocomplete="off" placeholder="请输入管理员用户名">
<small>重置链接将发送到该账号绑定的邮箱</small>
</div>
<button type="submit" class="btn-login" id="submitBtn">发送重置链接</button>
<div id="tipMsg" class="error-msg" style="display: none;"></div>
<p style="text-align:center; margin-top:14px;">
<a href="/index.php" class="link" style="font-size:14px;">返回登录</a>
</p>
</form>
<div class="login-footer">
<p>&copy; <?php echo date('Y'); ?> Sea Network Technology Studio</p>
<?php if (defined('ICP_ENABLED') && ICP_ENABLED && defined('ICP_NUMBER') && ICP_NUMBER): ?>
<p><a href="https://beian.miit.gov.cn/" target="_blank" rel="noopener noreferrer"><?php echo htmlspecialchars(ICP_NUMBER); ?></a></p>
<?php endif; ?>
</div>
</div>
<script>
window.API_BASE_URL = '<?php echo API_BASE_URL; ?>';
function showTip(msg, isError) {
const tip = document.getElementById('tipMsg');
tip.textContent = msg;
tip.className = isError ? 'error-msg' : 'success-msg';
tip.style.display = 'block';
}
document.getElementById('forgotForm').addEventListener('submit', async (e) => {
e.preventDefault();
const username = document.getElementById('username').value.trim();
if (!username) {
showTip('请输入管理员账号', true);
return;
}
const btn = document.getElementById('submitBtn');
btn.disabled = true;
btn.textContent = '发送中...';
try {
const response = await fetch(`${window.API_BASE_URL}/api/auth/forgot-password`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ username })
});
const data = await response.json();
if (data.success) {
showTip(data.message || '重置链接已发送,请查收邮箱', false);
} else {
showTip(data.message || '发送失败', true);
}
} catch (error) {
console.error('找回密码请求失败:', error);
showTip('网络错误,请稍后重试', true);
} finally {
btn.disabled = false;
btn.textContent = '发送重置链接';
}
});
</script>
</body>
</html>