11 lines
403 B
Python
11 lines
403 B
Python
from flask import Blueprint, render_template, session, redirect, url_for, flash
|
|
|
|
dashboard_bp = Blueprint('dashboard', __name__)
|
|
|
|
@dashboard_bp.route('/')
|
|
def index():
|
|
if not session.get('token'):
|
|
flash("请先登录", "warning")
|
|
return redirect(url_for('auth.login')) # 🚀 未登录用户跳转到登录页
|
|
return render_template('dashboard.html') # ✅ 主页为 dashboard
|