diff --git a/static/fsys.py b/static/fsys.py index 221ea78..934c0ce 100644 --- a/static/fsys.py +++ b/static/fsys.py @@ -217,9 +217,12 @@ def stream_video(file_path): # ==================== 主路由 ==================== @app.route('/') def serve_view(): - """根路径固定返回 __view.html 静态文件,由前端 JS 调用 /api/filelist 拉取文件系统信息""" + """根路径:优先返回 index.html(社区首页),不存在时回退到 __view.html(文件浏览)""" if not FILESYSTEM_ENABLED: return "文件系统未启用", 403 + index_path = os.path.join(HTML_ROOT_DIR, 'index.html') + if os.path.exists(index_path): + return send_file(index_path, mimetype='text/html') view_path = os.path.join(HTML_ROOT_DIR, VIEW_FILE) if not os.path.exists(view_path): return f"视图文件 {VIEW_FILE} 不存在", 500 diff --git a/static/public/index.html b/static/public/index.html new file mode 100644 index 0000000..f8490b5 --- /dev/null +++ b/static/public/index.html @@ -0,0 +1,58 @@ + + + + + + 树状菜单 · 开源社区 + + + + +
+
+

树状菜单

+

一个轻量的开源社区,用树的结构组织知识与文件。
自由生长,自由分享。

+
+
+ 登录 + 注册 +
+
开源 · 轻量 · 自托管
+
+ + +