From 7aa5efb9baa0ea99bc151f2808b387c803662aa3 Mon Sep 17 00:00:00 2001 From: ZLY Date: Wed, 26 Nov 2025 11:47:03 +0800 Subject: [PATCH] =?UTF-8?q?feat(test):=20=E6=9B=B4=E6=96=B0=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E5=AE=9E=E4=BE=8B=20WebSocket=20=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E5=B9=B6=E4=BC=98=E5=8C=96=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../componentDevelopment/componentTest/testInstance.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/pages/componentDevelopment/componentTest/testInstance.tsx b/src/pages/componentDevelopment/componentTest/testInstance.tsx index b5e7c04..de1cca5 100644 --- a/src/pages/componentDevelopment/componentTest/testInstance.tsx +++ b/src/pages/componentDevelopment/componentTest/testInstance.tsx @@ -31,14 +31,17 @@ const TestInstance = ({ instance, parentId, onBack }: { instance: any; parentId: // WebSocket hook const { connect, disconnect, isConnected, sendMessage } = useWebSocket({ onOpen: () => { + console.log('链接成功'); setIsSocketConnected(true); addLog('连接信息:连接成功!'); }, onClose: () => { + console.log('链接关闭'); setIsSocketConnected(false); addLog('连接信息:连接已断开'); }, onError: () => { + console.log('链接错误'); addLog('连接错误:连接失败'); }, onMessage: (event) => { @@ -107,10 +110,10 @@ const TestInstance = ({ instance, parentId, onBack }: { instance: any; parentId: const host = window.location.host; let wsUrl = ''; if (window.location.host.includes('localhost')) { - wsUrl = `ws://192.168.5.119/wst/test-case/${instance.id}/${cryptoRandom()}`; + wsUrl = `ws://192.168.5.119/ws/v1/bpms-workbench/test-case/${instance.id}/${cryptoRandom()}`; } else { - wsUrl = `${protocol}//${host}/wst/test-case/${instance.id}/${cryptoRandom()}`; + wsUrl = `${protocol}//${host}/ws/v1/bpms-workbench/test-case/${instance.id}/${cryptoRandom()}`; } @@ -510,7 +513,7 @@ const TestInstance = ({ instance, parentId, onBack }: { instance: any; parentId: {logs.length === 0 ? (

暂无日志信息

-

请点击"链接实例"按钮连接测试实例

+

请点击"链接实例"按钮连接测试实例

) : (