mirror of
https://github.com/zhinianboke/xianyu-auto-reply.git
synced 2025-08-30 01:27:35 +08:00
回退
This commit is contained in:
parent
307485df2f
commit
8d95fe8a4d
@ -755,7 +755,7 @@ class XianyuLive:
|
|||||||
|
|
||||||
# 保存cookies和token信息
|
# 保存cookies和token信息
|
||||||
db_manager.save_cookie(self.cookie_id, self.cookies_str, current_user_id)
|
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:
|
except Exception as e:
|
||||||
logger.error(f"更新数据库Cookie失败: {self._safe_str(e)}")
|
logger.error(f"更新数据库Cookie失败: {self._safe_str(e)}")
|
||||||
# 发送数据库更新失败通知
|
# 发送数据库更新失败通知
|
||||||
|
@ -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:
|
try:
|
||||||
cursor.execute('ALTER TABLE cookies ADD COLUMN current_token TEXT DEFAULT ""')
|
cursor.execute('ALTER TABLE cookies ADD COLUMN current_token TEXT DEFAULT ""')
|
||||||
@ -1096,7 +1089,6 @@ class DBManager:
|
|||||||
admin_user = cursor.fetchone()
|
admin_user = cursor.fetchone()
|
||||||
user_id = admin_user[0] if admin_user else 1
|
user_id = admin_user[0] if admin_user else 1
|
||||||
|
|
||||||
# 如果提供了token相关信息,则更新这些字段
|
|
||||||
self._execute_sql(cursor,
|
self._execute_sql(cursor,
|
||||||
"INSERT OR REPLACE INTO cookies (id, value, user_id) VALUES (?, ?, ?)",
|
"INSERT OR REPLACE INTO cookies (id, value, user_id) VALUES (?, ?, ?)",
|
||||||
(cookie_id, cookie_value, user_id)
|
(cookie_id, cookie_value, user_id)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user