用户系统
This commit is contained in:
		@@ -35,6 +35,9 @@
 | 
			
		||||
            box-shadow: var(--shadow);
 | 
			
		||||
            position: relative;
 | 
			
		||||
            overflow: hidden;
 | 
			
		||||
            display: flex;
 | 
			
		||||
            justify-content: space-between;
 | 
			
		||||
            align-items: center;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        .header:before {
 | 
			
		||||
@@ -62,6 +65,51 @@
 | 
			
		||||
            text-shadow: 0 0 5px rgba(0,0,0,0.2);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        .user-info {
 | 
			
		||||
            position: relative;
 | 
			
		||||
            z-index: 1;
 | 
			
		||||
            display: flex;
 | 
			
		||||
            align-items: center;
 | 
			
		||||
            gap: 15px;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        .user-info .username {
 | 
			
		||||
            font-size: 14px;
 | 
			
		||||
            opacity: 0.9;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        .user-info .permission-badge {
 | 
			
		||||
            background: rgba(255, 255, 255, 0.2);
 | 
			
		||||
            padding: 4px 8px;
 | 
			
		||||
            border-radius: 12px;
 | 
			
		||||
            font-size: 12px;
 | 
			
		||||
            font-weight: 500;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        .user-info .permission-badge.admin {
 | 
			
		||||
            background: var(--accent);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        .user-info .permission-badge.user {
 | 
			
		||||
            background: var(--success);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        .logout-btn {
 | 
			
		||||
            background: rgba(255, 255, 255, 0.2);
 | 
			
		||||
            border: 1px solid rgba(255, 255, 255, 0.3);
 | 
			
		||||
            color: white;
 | 
			
		||||
            padding: 6px 12px;
 | 
			
		||||
            border-radius: 4px;
 | 
			
		||||
            text-decoration: none;
 | 
			
		||||
            font-size: 12px;
 | 
			
		||||
            transition: var(--transition);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        .logout-btn:hover {
 | 
			
		||||
            background: rgba(255, 255, 255, 0.3);
 | 
			
		||||
            color: white;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        .sidebar {
 | 
			
		||||
            width: 240px;
 | 
			
		||||
            height: calc(100vh - 60px);
 | 
			
		||||
@@ -152,6 +200,15 @@
 | 
			
		||||
<body>
 | 
			
		||||
    <div class="header">
 | 
			
		||||
        <h1><span>紫金</span> 稷下薪火·云枢智海师生成果共创系统</h1>
 | 
			
		||||
        <div class="user-info">
 | 
			
		||||
            <span class="username">{{ session.username }}</span>
 | 
			
		||||
            {% if session.permission == 0 %}
 | 
			
		||||
                <span class="permission-badge admin">管理员</span>
 | 
			
		||||
            {% elif session.permission == 1 %}
 | 
			
		||||
                <span class="permission-badge user">普通用户</span>
 | 
			
		||||
            {% endif %}
 | 
			
		||||
            <a href="{{ url_for('logout') }}" class="logout-btn">登出</a>
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
    <div class="sidebar">
 | 
			
		||||
@@ -161,12 +218,53 @@
 | 
			
		||||
        <a href="{{ url_for('results_page') }}" {% if request.endpoint == 'results_page' %}class="active"{% endif %}>
 | 
			
		||||
            <i>📈</i> 查询统计
 | 
			
		||||
        </a>
 | 
			
		||||
        <a href="{{ url_for('my_data') }}" {% if request.endpoint == 'my_data' or request.endpoint == 'edit_entry' %}class="active"{% endif %}>
 | 
			
		||||
            <i>📋</i> 我的数据
 | 
			
		||||
        </a>
 | 
			
		||||
        {% if session.permission == 0 %}
 | 
			
		||||
        <a href="{{ url_for('show_all') }}" {% if request.endpoint == 'show_all' %}class="active"{% endif %}>
 | 
			
		||||
            <i>📁</i> 数据操作
 | 
			
		||||
        </a>
 | 
			
		||||
        {% endif %}
 | 
			
		||||
        <a href="{{ url_for('profile') }}" {% if request.endpoint == 'profile' %}class="active"{% endif %}>
 | 
			
		||||
            <i>⚙️</i> 个人设置
 | 
			
		||||
        </a>
 | 
			
		||||
        {% if session.permission == 0 %}
 | 
			
		||||
        <a href="{{ url_for('user_management') }}" {% if request.endpoint == 'user_management' or request.endpoint == 'register' %}class="active"{% endif %}>
 | 
			
		||||
            <i>👥</i> 用户管理
 | 
			
		||||
        </a>
 | 
			
		||||
        {% endif %}
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
    <div class="content">
 | 
			
		||||
        <!-- Flash消息显示 -->
 | 
			
		||||
        {% with messages = get_flashed_messages(with_categories=true) %}
 | 
			
		||||
            {% if messages %}
 | 
			
		||||
                <div class="flash-messages" style="margin-bottom: 20px;">
 | 
			
		||||
                    {% for category, message in messages %}
 | 
			
		||||
                        <div class="flash-message {{ category }}" style="padding: 10px; border-radius: 5px; margin-bottom: 10px;">{{ message }}</div>
 | 
			
		||||
                    {% endfor %}
 | 
			
		||||
                </div>
 | 
			
		||||
                <style>
 | 
			
		||||
                    .flash-message.error {
 | 
			
		||||
                        background-color: #f8d7da;
 | 
			
		||||
                        color: #721c24;
 | 
			
		||||
                        border: 1px solid #f5c6cb;
 | 
			
		||||
                    }
 | 
			
		||||
                    .flash-message.success {
 | 
			
		||||
                        background-color: #d4edda;
 | 
			
		||||
                        color: #155724;
 | 
			
		||||
                        border: 1px solid #c3e6cb;
 | 
			
		||||
                    }
 | 
			
		||||
                    .flash-message.info {
 | 
			
		||||
                        background-color: #d1ecf1;
 | 
			
		||||
                        color: #0c5460;
 | 
			
		||||
                        border: 1px solid #bee5eb;
 | 
			
		||||
                    }
 | 
			
		||||
                </style>
 | 
			
		||||
            {% endif %}
 | 
			
		||||
        {% endwith %}
 | 
			
		||||
        
 | 
			
		||||
        {% block content %}
 | 
			
		||||
        {% endblock %}
 | 
			
		||||
    </div>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user