feat: 远程浏览器功能 - Web面板内嵌操作滑块验证
- 新增 remote_browser.py: CDP screencast截图流 + 鼠标/键盘事件转发 - Flask-SocketIO 实时通信 - 短信登录时弹出远程浏览器窗口,用户直接在Web页面拖滑块 - 自动检测登录成功并保存auth状态
This commit is contained in:
@@ -89,10 +89,7 @@ def do_login(account_id):
|
||||
|
||||
@bp.route('/login_sms/<int:account_id>', methods=['POST'])
|
||||
def do_sms_login(account_id):
|
||||
"""
|
||||
短信验证码登录(需要人机交互)
|
||||
会弹出浏览器窗口,需要人拖滑块 + 输入验证码。
|
||||
"""
|
||||
"""短信验证码登录 — 远程浏览器模式,在 Web 面板中操作"""
|
||||
db = get_db()
|
||||
account = db.execute('SELECT * FROM accounts WHERE id = ?', (account_id,)).fetchone()
|
||||
db.close()
|
||||
@@ -114,10 +111,13 @@ def do_sms_login(account_id):
|
||||
db.commit()
|
||||
db.close()
|
||||
|
||||
# 后台启动短信登录(会弹出浏览器窗口)
|
||||
_start_bg_sms_login(account_id, phone)
|
||||
# 启动远程浏览器会话
|
||||
from server.app import socketio
|
||||
from server.services.remote_browser import start_session
|
||||
session_id = start_session(account_id, phone, socketio)
|
||||
|
||||
return jsonify(success=True, msg='已启动短信登录,请在弹出的浏览器中完成滑块验证,并在终端输入验证码')
|
||||
return jsonify(success=True, session_id=session_id,
|
||||
msg='远程浏览器已启动,请在弹出窗口中操作')
|
||||
|
||||
|
||||
@bp.route('/status/<int:account_id>')
|
||||
|
||||
Reference in New Issue
Block a user