Update API key (for external API calls, NOT for admin login)
(
request: UpdateAPIKeyRequest,
token: str = Depends(verify_admin_token)
)
| 1581 | |
| 1582 | @router.post("/api/admin/apikey") |
| 1583 | async def update_api_key( |
| 1584 | request: UpdateAPIKeyRequest, |
| 1585 | token: str = Depends(verify_admin_token) |
| 1586 | ): |
| 1587 | """Update API key (for external API calls, NOT for admin login)""" |
| 1588 | # Update API key in database |
| 1589 | await db.update_admin_config(api_key=request.new_api_key) |
| 1590 | |
| 1591 | # 🔥 Hot reload: sync database config to memory |
| 1592 | await db.reload_config_to_memory() |
| 1593 | |
| 1594 | return {"success": True, "message": "API Key更新成功"} |
| 1595 | |
| 1596 | |
| 1597 | @router.post("/api/admin/debug") |
nothing calls this directly
no test coverage detected