mirror of
https://github.com/TheSmallHanCat/sora2api.git
synced 2026-02-13 17:34:42 +08:00
fix: api_key持久化
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user