实现注册时的邮箱验证功能: - 修改注册API支持邮箱验证流程 - 新增邮箱验证API (/api/verify-email/<token>) - 新增重发验证邮件API (/api/resend-verify-email) - 新增邮箱验证状态查询API (/api/email/verify-status) 新增文件: - templates/email/register.html - 注册验证邮件模板 - templates/verify_success.html - 验证成功页面 - templates/verify_failed.html - 验证失败页面 修改文件: - email_service.py - 添加发送注册验证邮件函数 - app.py - 添加邮箱验证相关API - database.py - 添加get_user_by_email函数 - app_config.py - 添加BASE_URL配置 - templates/register.html - 支持邮箱必填切换 - templates/login.html - 添加重发验证邮件功能 - templates/admin.html - 添加注册验证开关和BASE_URL设置 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
110 lines
3.1 KiB
HTML
110 lines
3.1 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>邮箱验证成功 - 知识管理平台</title>
|
|
<style>
|
|
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
}
|
|
body {
|
|
font-family: 'Microsoft YaHei', Arial, sans-serif;
|
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
min-height: 100vh;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: 20px;
|
|
}
|
|
.card {
|
|
background: white;
|
|
border-radius: 15px;
|
|
box-shadow: 0 10px 40px rgba(0,0,0,0.2);
|
|
padding: 50px 40px;
|
|
text-align: center;
|
|
max-width: 450px;
|
|
width: 100%;
|
|
}
|
|
.icon {
|
|
width: 80px;
|
|
height: 80px;
|
|
background: linear-gradient(135deg, #27ae60, #2ecc71);
|
|
border-radius: 50%;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
margin: 0 auto 25px;
|
|
}
|
|
.icon svg {
|
|
width: 40px;
|
|
height: 40px;
|
|
fill: white;
|
|
}
|
|
h1 {
|
|
color: #27ae60;
|
|
font-size: 28px;
|
|
margin-bottom: 15px;
|
|
}
|
|
p {
|
|
color: #666;
|
|
font-size: 16px;
|
|
line-height: 1.8;
|
|
margin-bottom: 30px;
|
|
}
|
|
.btn {
|
|
display: inline-block;
|
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
color: white;
|
|
text-decoration: none;
|
|
padding: 15px 40px;
|
|
border-radius: 30px;
|
|
font-size: 16px;
|
|
font-weight: bold;
|
|
transition: transform 0.2s, box-shadow 0.2s;
|
|
}
|
|
.btn:hover {
|
|
transform: translateY(-2px);
|
|
box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
|
|
}
|
|
.countdown {
|
|
color: #999;
|
|
font-size: 14px;
|
|
margin-top: 20px;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="card">
|
|
<div class="icon">
|
|
<svg viewBox="0 0 24 24">
|
|
<path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/>
|
|
</svg>
|
|
</div>
|
|
<h1>验证成功</h1>
|
|
<p>
|
|
您的邮箱已验证成功!<br>
|
|
账号已激活,现在可以登录使用了。
|
|
</p>
|
|
<a href="/login" class="btn">立即登录</a>
|
|
<p class="countdown">
|
|
<span id="seconds">5</span> 秒后自动跳转到登录页面...
|
|
</p>
|
|
</div>
|
|
|
|
<script>
|
|
let seconds = 5;
|
|
const countdown = setInterval(() => {
|
|
seconds--;
|
|
document.getElementById('seconds').textContent = seconds;
|
|
if (seconds <= 0) {
|
|
clearInterval(countdown);
|
|
window.location.href = '/login';
|
|
}
|
|
}, 1000);
|
|
</script>
|
|
</body>
|
|
</html>
|