From 2db8e834a8562568a5b603e2a6031531b491acb6 Mon Sep 17 00:00:00 2001 From: qaq <1937228092@qq.com> Date: Thu, 3 Jul 2025 11:55:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dws=E8=BF=9E=E6=8E=A5=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vite-frontend/src/pages/node.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vite-frontend/src/pages/node.tsx b/vite-frontend/src/pages/node.tsx index 88cefc0..f548dda 100644 --- a/vite-frontend/src/pages/node.tsx +++ b/vite-frontend/src/pages/node.tsx @@ -114,8 +114,8 @@ export default function NodePage() { closeWebSocket(); } - // 构建WebSocket URL,将HTTP协议转换为WS协议 - let baseUrl = import.meta.env.VITE_API_BASE || 'http://localhost:8080'; + // 构建WebSocket URL,使用与API相同的地址逻辑 + let baseUrl = import.meta.env.VITE_API_BASE || window.location.origin; const wsUrl = baseUrl.replace(/^http/, 'ws') + `/system-info?type=0&secret=${localStorage.getItem('token')}`; try {