Merge branch 'r-dev' of https://github.com/Mai-with-u/MaiBot into r-dev

This commit is contained in:
SengokuCola
2026-04-17 10:57:22 +08:00
3 changed files with 11 additions and 10 deletions

View File

@@ -205,11 +205,12 @@ def _setup_static_files(app: FastAPI):
def _resolve_static_path() -> Path | None:
# 开发环境优先允许复用仓库里的现成 dist
base_dir = _get_project_root()
static_path = base_dir / "dashboard" / "dist"
if static_path.is_dir() and (static_path / "index.html").exists():
return static_path
# 临时仅允许使用已安装的 maibot-dashboard 包,不使用仓库本地 dashboard/dist
# 如需恢复本地回退逻辑,可取消下方注释。
# base_dir = _get_project_root()
# static_path = base_dir / "dashboard" / "dist"
# if static_path.is_dir() and (static_path / "index.html").exists():
# return static_path
try:
module = import_module("maibot_dashboard")