自动获取真实姓名作为账号备注(静默完成)
This commit is contained in:
13
app.py
13
app.py
@@ -2109,7 +2109,18 @@ def run_task(user_id, account_id, browse_type, enable_screenshot=True, source="m
|
||||
# 保存cookies供截图使用
|
||||
api_browser.save_cookies_for_playwright(account.username)
|
||||
database.reset_account_login_status(account_id)
|
||||
|
||||
|
||||
# 如果账号没有备注,自动获取真实姓名作为备注
|
||||
if not account.remark:
|
||||
try:
|
||||
real_name = api_browser.get_real_name()
|
||||
if real_name:
|
||||
account.remark = real_name
|
||||
database.update_account_remark(account_id, real_name)
|
||||
socketio.emit('account_update', account.to_dict(), room=f'user_{user_id}')
|
||||
except Exception:
|
||||
pass # 静默失败,不影响任务执行
|
||||
|
||||
if account_id in task_status:
|
||||
task_status[account_id]["detail_status"] = "正在浏览"
|
||||
log_to_client(f"开始浏览 '{browse_type}' 内容...", user_id, account_id)
|
||||
|
||||
Reference in New Issue
Block a user