fix: 恢复截图顺序,保持完整框架样式

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-14 12:38:52 +08:00
parent f04c5c1c8f
commit 1b85f34a0f

View File

@@ -311,14 +311,7 @@ def take_screenshot_for_account(
screenshot_path = os.path.join(SCREENSHOTS_DIR, screenshot_filename) screenshot_path = os.path.join(SCREENSHOTS_DIR, screenshot_filename)
cookies_for_shot = cookie_path if is_cookie_jar_fresh(cookie_path) else None cookies_for_shot = cookie_path if is_cookie_jar_fresh(cookie_path) else None
# 优先直接截取目标页面center.aspx?bz=X避免 iframe 加载问题
if take_screenshot_wkhtmltoimage( if take_screenshot_wkhtmltoimage(
target_url,
screenshot_path,
cookies_path=cookies_for_shot,
proxy_server=proxy_server,
log_callback=custom_log,
) or take_screenshot_wkhtmltoimage(
index_url, index_url,
screenshot_path, screenshot_path,
cookies_path=cookies_for_shot, cookies_path=cookies_for_shot,
@@ -326,6 +319,12 @@ def take_screenshot_for_account(
run_script=run_script, run_script=run_script,
window_status="ready", window_status="ready",
log_callback=custom_log, log_callback=custom_log,
) or take_screenshot_wkhtmltoimage(
target_url,
screenshot_path,
cookies_path=cookies_for_shot,
proxy_server=proxy_server,
log_callback=custom_log,
): ):
if os.path.exists(screenshot_path) and os.path.getsize(screenshot_path) > 1000: if os.path.exists(screenshot_path) and os.path.getsize(screenshot_path) > 1000:
log_to_client(f"✓ 截图成功: {screenshot_filename}", user_id, account_id) log_to_client(f"✓ 截图成功: {screenshot_filename}", user_id, account_id)