This commit is contained in:
zhinianboke 2025-08-13 18:31:11 +08:00
parent 307485df2f
commit 8d95fe8a4d
2 changed files with 1 additions and 9 deletions

View File

@ -755,7 +755,7 @@ class XianyuLive:
# 保存cookies和token信息
db_manager.save_cookie(self.cookie_id, self.cookies_str, current_user_id)
logger.debug(f"已更新Cookie和token信息到数据库: {self.cookie_id}")
logger.debug(f"已更新Cookie到数据库: {self.cookie_id}")
except Exception as e:
logger.error(f"更新数据库Cookie失败: {self._safe_str(e)}")
# 发送数据库更新失败通知

View File

@ -120,13 +120,6 @@ class DBManager:
)
''')
# 为现有的cookies表添加新字段如果不存在
try:
cursor.execute('ALTER TABLE cookies ADD COLUMN last_token_refresh_time REAL DEFAULT 0')
logger.info("已为cookies表添加last_token_refresh_time字段")
except sqlite3.OperationalError:
# 字段已存在,忽略错误
pass
try:
cursor.execute('ALTER TABLE cookies ADD COLUMN current_token TEXT DEFAULT ""')
@ -1096,7 +1089,6 @@ class DBManager:
admin_user = cursor.fetchone()
user_id = admin_user[0] if admin_user else 1
# 如果提供了token相关信息则更新这些字段
self._execute_sql(cursor,
"INSERT OR REPLACE INTO cookies (id, value, user_id) VALUES (?, ?, ?)",
(cookie_id, cookie_value, user_id)