diff --git a/app.py b/app.py index 1258150..7c4b082 100755 --- a/app.py +++ b/app.py @@ -21,10 +21,16 @@ async def mail_qq_spider(account: str,display: int) -> str: Returns: str: 爬虫结果 """ - os.environ['DISPLAY'] = f':{display}' # 改成你的 VNC 显示器编号 - - result = await asyncio.to_thread(a1, account, display) - return result + data={"display": display} + try: + os.environ['DISPLAY'] = f':{display}' + result = await asyncio.to_thread(a1, account, display) + data["status"] = 200 + data["result"] = result + return json.dumps(data, ensure_ascii=False) + except Exception as e: + data["status"] = 500 + return json.dumps(data, ensure_ascii=False) @mcp.tool() async def start_vnc_server(display: int) -> str: """启动VNC服务