feat: AI账号api_key加密存储 + 余额刷新接口与前端按钮

This commit is contained in:
gouki
2026-08-02 17:26:59 +00:00
parent 1e574315bd
commit 2e3e9f8b0b
7 changed files with 124 additions and 5 deletions
+4
View File
@@ -64,6 +64,10 @@ def _migrate_assets_db() -> None:
cols = {c["name"] for c in insp.get_columns("providers")}
if "last_synced_at" not in cols:
conn.execute(sa.text("ALTER TABLE providers ADD COLUMN last_synced_at DATETIME"))
if insp.has_table("ai_accounts"):
cols = {c["name"] for c in insp.get_columns("ai_accounts")}
if "api_key_encrypted" not in cols:
conn.execute(sa.text("ALTER TABLE ai_accounts ADD COLUMN api_key_encrypted VARCHAR"))
def get_session() -> Generator[Session, None, None]: