This commit is contained in:
Your Name
2026-07-23 17:56:25 +08:00
parent a05dae8412
commit 4970d8f8d3
4262 changed files with 735221 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
"""帮助中心静态页面。"""
from pathlib import Path
from fastapi import HTTPException
from fastapi.responses import FileResponse
from settings import BACKEND_DIR, PROJECT_ROOT
HELP_STATIC_DIR = BACKEND_DIR / "static" / "help"
CREDENTIAL_TOOL_CANDIDATES = (
PROJECT_ROOT / "凭证采集工具.html",
HELP_STATIC_DIR / "credential-tool.html",
)
def _resolve_credential_tool_html() -> Path:
for path in CREDENTIAL_TOOL_CANDIDATES:
if path.is_file():
return path
raise HTTPException(status_code=404, detail="凭证采集工具页面不存在")
def serve_credential_tool() -> FileResponse:
html_path = _resolve_credential_tool_html()
return FileResponse(
html_path,
media_type="text/html; charset=utf-8",
content_disposition_type="inline",
)