- 在 applications/config.py 中通过 PLUGIN_ENABLE_FOLDERS 启用 4 个业务插件
- 删除 framework 内 applications/view/system/nav.py 与 templates/system/nav/* 模板
- applications/extensions/init_plugs 移除重复的 broadcast_execute('event_init'/'event_finish')
(由 init_bps / init_script 触发,避免 Blueprint 注册冲突)
- applications/view/system/index.py:未登录访问 / 直接渲染前台公开聚合页
- templates/system/index.html:移动端首屏即折叠侧边栏
- 新增 5 个 model(Nav 字段 status→enable 兼容、NavCategory、About、Friend、VisitLog/PageStat、NavClick)
- 新增 2 个 schema(NavCategorySchema、FriendOutSchema/ManageSchema)
- admin_about/admin_friend/admin_nav_category 在 init.json 中以「网站管理」分组挂载
- .gitignore 补充一次性备份、调试截图、探针截图不入库
19 lines
638 B
Python
19 lines
638 B
Python
from flask import Blueprint, render_template
|
|
from flask_login import login_required, current_user, login_fresh
|
|
|
|
from applications.view.public.nav import render_public_index
|
|
|
|
bp = Blueprint('index', __name__, url_prefix='/')
|
|
|
|
|
|
# 首页:未登录 → 前台公开导航聚合页;已登录 → 跳到工作台
|
|
@bp.get('/')
|
|
def index():
|
|
# 已登录用户访问根路径时,直接进后台工作台;
|
|
# 匿名访问则直接渲染前台导航页(不重定向,地址栏保持 /)
|
|
if current_user.is_authenticated:
|
|
return render_template('system/index.html', user=current_user)
|
|
return render_public_index()
|
|
|
|
|