fix: api_key持久化

This commit is contained in:
TheSmallHanCat
2025-12-12 08:45:58 +08:00
parent 6b81188b6f
commit 5225170d71
4 changed files with 23 additions and 9 deletions

View File

@@ -509,6 +509,13 @@ async def update_api_key(
):
"""Update API key"""
try:
# Get current admin config from database
admin_config = await db.get_admin_config()
# Update api_key in database
admin_config.api_key = request.new_api_key
await db.update_admin_config(admin_config)
# Update in-memory config
config.api_key = request.new_api_key