关闭前台自助注册:登录页去除注册链接,删除注册页与/register/路由
This commit is contained in:
@@ -161,10 +161,6 @@ class PublicApp:
|
||||
|
||||
return self._render('change_password.html', {}, request)
|
||||
|
||||
@app.route('/register/', methods=['GET'])
|
||||
async def register(request):
|
||||
return self._redirect('/admin/login/')
|
||||
|
||||
@app.route('/announcements/', methods=['GET'])
|
||||
async def announcement_list(request):
|
||||
user = self._get_optional_user(request)
|
||||
|
||||
@@ -77,7 +77,7 @@ body {
|
||||
<button type="submit" class="btn">登 录</button>
|
||||
</form>
|
||||
<div class="footer-link">
|
||||
没有账号?<a href="/register/">注册</a>
|
||||
账号由管理员统一开通,如需账号请联系管理员。
|
||||
</div>
|
||||
</div>
|
||||
<div class="copyright">{{ site_footer|safe }}</div>
|
||||
|
||||
@@ -1,98 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>注册 - {{ site_name }}</title>
|
||||
<style>
|
||||
:root {
|
||||
--primary: #2563eb;
|
||||
--bg: #f1f5f9;
|
||||
--card-bg: #ffffff;
|
||||
--text: #1e293b;
|
||||
--text-light: #64748b;
|
||||
--border: #e2e8f0;
|
||||
--radius: 8px;
|
||||
--shadow: 0 4px 6px rgba(0,0,0,0.07);
|
||||
}
|
||||
* { margin:0; padding:0; box-sizing:border-box; }
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
||||
font-size: 14px;
|
||||
color: var(--text);
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.wrap { width:100%; max-width:420px; padding:20px; }
|
||||
.card {
|
||||
background: var(--card-bg);
|
||||
border-radius: var(--radius);
|
||||
box-shadow: var(--shadow);
|
||||
padding: 36px;
|
||||
}
|
||||
.card h1 { font-size:22px; text-align:center; margin-bottom:6px; }
|
||||
.card .subtitle { text-align:center; color:var(--text-light); margin-bottom:24px; font-size:14px; }
|
||||
.form-group { margin-bottom:18px; }
|
||||
.form-group label { display:block; font-size:13px; font-weight:500; margin-bottom:6px; }
|
||||
.form-control {
|
||||
width:100%; padding:10px 14px; border:1px solid var(--border); border-radius:6px;
|
||||
font-size:14px; color:var(--text); outline:none; transition:border-color 0.15s;
|
||||
font-family:inherit;
|
||||
}
|
||||
.form-control:focus { border-color:var(--primary); box-shadow:0 0 0 3px rgba(37,99,235,0.1); }
|
||||
.btn {
|
||||
width:100%; padding:10px 16px; border:none; border-radius:6px; font-size:15px;
|
||||
font-weight:500; cursor:pointer; background:var(--primary); color:#fff; transition:background 0.15s;
|
||||
}
|
||||
.btn:hover { background:#1d4ed8; }
|
||||
.alert {
|
||||
background:#fce4ec; color:#c62828; padding:10px 14px; border-radius:6px;
|
||||
margin-bottom:16px; font-size:13px;
|
||||
}
|
||||
.alert-success { background:#dcfce7; color:#166534; }
|
||||
.footer-link { text-align:center; margin-top:16px; font-size:13px; }
|
||||
.footer-link a { color:var(--primary); }
|
||||
.copyright { text-align:center; margin-top:20px; color:rgba(255,255,255,0.6); font-size:13px; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="wrap">
|
||||
<div class="card">
|
||||
<h1>注册账号</h1>
|
||||
<div class="subtitle">加入社区,参与讨论</div>
|
||||
{% if message %}
|
||||
<div class="alert alert-success">{{ message }}</div>
|
||||
{% endif %}
|
||||
{% if error %}
|
||||
<div class="alert">{{ error }}</div>
|
||||
{% endif %}
|
||||
<form method="post" action="/register/">
|
||||
<div class="form-group">
|
||||
<label for="username">用户名</label>
|
||||
<input type="text" id="username" name="username" class="form-control" placeholder="请输入用户名" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="email">邮箱(选填)</label>
|
||||
<input type="email" id="email" name="email" class="form-control" placeholder="请输入邮箱">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="password">密码</label>
|
||||
<input type="password" id="password" name="password" class="form-control" placeholder="请输入密码" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="confirm">确认密码</label>
|
||||
<input type="password" id="confirm" name="confirm" class="form-control" placeholder="再次输入密码" required>
|
||||
</div>
|
||||
<button type="submit" class="btn">注册</button>
|
||||
</form>
|
||||
<div class="footer-link">
|
||||
已有账号?<a href="/login/">登录</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="copyright">{{ site_footer|safe }}</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user