Show WeCom machine name after brand title on shell and login.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-08-02 11:43:02 +08:00
parent 9427d9c429
commit ead3545df8
5 changed files with 72 additions and 5 deletions
+11
View File
@@ -98,16 +98,27 @@ async def login(
)
@router.get("/branding")
async def branding() -> dict:
"""登录页/顶栏展示用(无敏感信息):与企微通知同一机器名。"""
from ..notify import wecom
return {"machine_name": wecom.wecom_machine_name() or ""}
@router.get("/me")
async def me(
username: Annotated[str, Depends(require_user)],
settings: Annotated[Settings, Depends(get_settings)],
) -> dict:
from ..notify import wecom
return {
"username": username,
"env_name": settings.env_name,
"mode": settings.mode,
"sim": settings.is_sim,
"machine_name": wecom.wecom_machine_name() or "",
}