1. 让AI修改了一些bug

This commit is contained in:
2026-01-16 11:49:05 +08:00
parent 43b6018a3e
commit 2ebd4ea09e
6 changed files with 2938 additions and 37 deletions

View File

@@ -190,9 +190,8 @@ def setup_routes(app: FastAPI):
@app.get("/")
async def root():
"""根路径 - 重定向到前端监控界面"""
from fastapi.responses import RedirectResponse
return RedirectResponse(url="/dashboard")
"""根路径 - 返回主界面"""
return FileResponse("../web/main.html")
@app.get("/dashboard")
async def dashboard():
@@ -307,12 +306,6 @@ def setup_routes(app: FastAPI):
# 挂载静态文件目录
from fastapi.responses import FileResponse
# 为前端页面创建特定路由
@app.get("/dashboard")
async def dashboard():
"""前端监控界面"""
return FileResponse("static/index.html")
# 只挂载静态资源CSS, JS, 图片等)- 如果目录存在
import os
if os.path.exists("static"):