Files
weibo_signin/frontend/templates/base.html
Jeason e514a11e62 注册码 + 管理员系统:
User 模型新增 is_admin 字段
新增 InviteCode 模型(邀请码表)
注册接口必须提供有效邀请码,使用后自动标记
管理员接口:查看所有用户、启用/禁用用户、生成/删除邀请码
前端新增管理面板页面 /admin,导航栏对管理员显示入口
注册页面新增邀请码输入框
选择性超话签到:

新增 GET /api/v1/accounts/{id}/topics 接口获取超话列表
POST /signin 接口支持 {"topic_indices": [0,1,3]} 选择性签到
新增超话选择页面 /accounts/{id}/topics,支持全选/手动勾选
账号详情页新增"选择超话签到"按钮
2026-03-17 17:05:28 +08:00

250 lines
8.6 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>{% block title %}微博超话签到{% endblock %}</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
background: linear-gradient(135deg, #f0f2ff 0%, #faf5ff 50%, #fff0f6 100%);
color: #1a1a2e;
min-height: 100vh;
}
.navbar {
background: rgba(255,255,255,0.85);
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
border-bottom: 1px solid rgba(99,102,241,0.08);
padding: 0 24px;
position: sticky;
top: 0;
z-index: 100;
}
.navbar-content {
max-width: 1200px;
margin: 0 auto;
display: flex;
justify-content: space-between;
align-items: center;
height: 64px;
}
.navbar-brand {
font-size: 22px;
font-weight: 700;
background: linear-gradient(135deg, #6366f1, #a855f7);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
text-decoration: none;
}
.navbar-menu {
display: flex;
gap: 28px;
align-items: center;
}
.navbar-menu > a {
color: #64748b;
text-decoration: none;
font-size: 15px;
font-weight: 500;
transition: color 0.2s;
padding: 6px 0;
}
.navbar-menu > a:hover { color: #6366f1; }
.navbar-user {
display: flex;
gap: 14px;
align-items: center;
}
.navbar-user span {
color: #475569;
font-size: 14px;
font-weight: 500;
}
.btn-logout {
background: linear-gradient(135deg, #f43f5e, #e11d48);
color: white;
padding: 7px 18px;
border: none;
border-radius: 20px;
cursor: pointer;
text-decoration: none;
font-size: 13px;
font-weight: 500;
transition: opacity 0.2s;
}
.btn-logout:hover { opacity: 0.85; }
.container {
max-width: 1200px;
margin: 28px auto;
padding: 0 20px;
}
.alert {
padding: 14px 20px;
margin-bottom: 20px;
border-radius: 16px;
font-size: 14px;
font-weight: 500;
}
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.form-group { margin-bottom: 20px; }
label { display: block; margin-bottom: 8px; font-weight: 600; color: #334155; font-size: 14px; }
input[type="text"], input[type="email"], input[type="password"], textarea, select {
width: 100%;
padding: 12px 16px;
border: 1.5px solid #e2e8f0;
border-radius: 14px;
font-size: 14px;
font-family: inherit;
background: #fff;
transition: border-color 0.2s, box-shadow 0.2s;
}
input[type="text"]:focus, input[type="email"]:focus, input[type="password"]:focus,
textarea:focus, select:focus {
outline: none;
border-color: #818cf8;
box-shadow: 0 0 0 4px rgba(99,102,241,0.1);
}
textarea { resize: vertical; min-height: 100px; }
.btn {
padding: 10px 22px;
border: none;
border-radius: 14px;
cursor: pointer;
font-size: 14px;
font-weight: 600;
transition: all 0.2s;
text-decoration: none;
display: inline-block;
}
.btn-primary {
background: linear-gradient(135deg, #6366f1, #818cf8);
color: white;
box-shadow: 0 2px 8px rgba(99,102,241,0.25);
}
.btn-primary:hover { box-shadow: 0 4px 16px rgba(99,102,241,0.35); transform: translateY(-1px); }
.btn-secondary { background: #f1f5f9; color: #475569; }
.btn-secondary:hover { background: #e2e8f0; }
.btn-danger {
background: linear-gradient(135deg, #f43f5e, #e11d48);
color: white;
box-shadow: 0 2px 8px rgba(244,63,94,0.25);
}
.btn-danger:hover { box-shadow: 0 4px 16px rgba(244,63,94,0.35); }
.btn-success {
background: linear-gradient(135deg, #10b981, #059669);
color: white;
box-shadow: 0 2px 8px rgba(16,185,129,0.25);
}
.btn-success:hover { box-shadow: 0 4px 16px rgba(16,185,129,0.35); }
.btn-group { display: flex; gap: 10px; margin-top: 20px; }
.card {
background: rgba(255,255,255,0.9);
backdrop-filter: blur(8px);
border-radius: 20px;
box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.04);
padding: 24px;
margin-bottom: 20px;
border: 1px solid rgba(255,255,255,0.6);
}
.card-header {
font-size: 17px;
font-weight: 700;
margin-bottom: 16px;
padding-bottom: 12px;
border-bottom: 2px solid #f1f5f9;
color: #1e293b;
}
.badge {
display: inline-block;
padding: 4px 14px;
border-radius: 20px;
font-size: 12px;
font-weight: 600;
}
.badge-success { background: #ecfdf5; color: #059669; }
.badge-warning { background: #fffbeb; color: #d97706; }
.badge-danger { background: #fef2f2; color: #dc2626; }
.badge-info { background: #eff6ff; color: #2563eb; }
table { width: 100%; border-collapse: collapse; margin-top: 12px; }
th {
background: #f8fafc;
padding: 12px 16px;
text-align: left;
font-weight: 600;
font-size: 13px;
color: #64748b;
text-transform: uppercase;
letter-spacing: 0.5px;
border-bottom: 2px solid #e2e8f0;
}
td { padding: 14px 16px; border-bottom: 1px solid #f1f5f9; font-size: 14px; }
tr:hover { background: #f8fafc; }
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 20px; }
.pagination a, .pagination span {
padding: 8px 14px;
border: 1.5px solid #e2e8f0;
border-radius: 12px;
text-decoration: none;
color: #6366f1;
font-size: 14px;
font-weight: 500;
}
.pagination a:hover { background: #f1f5f9; }
.pagination .active { background: #6366f1; color: white; border-color: #6366f1; }
@media (max-width: 768px) {
.navbar-menu { display: none; }
.btn-group { flex-direction: column; }
.btn { width: 100%; text-align: center; }
}
</style>
{% block extra_css %}{% endblock %}
</head>
<body>
{% if session.get('user') %}
<nav class="navbar">
<div class="navbar-content">
<a href="{{ url_for('dashboard') }}" class="navbar-brand">🔥 微博超话签到</a>
<div class="navbar-menu">
<a href="{{ url_for('dashboard') }}">控制台</a>
{% if session.get('user', {}).get('is_admin') %}
<a href="{{ url_for('admin_panel') }}">🛡️ 管理</a>
{% endif %}
<div class="navbar-user">
<span>👤 {{ session.get('user').get('username') }}</span>
<a href="{{ url_for('logout') }}" class="btn-logout">退出</a>
</div>
</div>
</div>
</nav>
{% endif %}
<div class="container">
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
{% for category, message in messages %}
<div class="alert alert-{{ category }}">{{ message }}</div>
{% endfor %}
{% endif %}
{% endwith %}
{% block content %}{% endblock %}
</div>
</body>
</html>