From 5ab750a87f87f7cad217e97d1c4960ab56f29456 Mon Sep 17 00:00:00 2001 From: gzt Date: Sat, 14 Dec 2024 18:45:47 +0800 Subject: [PATCH] =?UTF-8?q?update:=E5=9C=A8utils/getServerInfo=E4=B8=AD?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86=E4=B8=80=E4=BA=9B=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/getServerInfo.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/getServerInfo.ts b/src/utils/getServerInfo.ts index 9b98eb1..03655a4 100644 --- a/src/utils/getServerInfo.ts +++ b/src/utils/getServerInfo.ts @@ -4,7 +4,7 @@ export function getServerInfo() { // 获取主机名(IP 或域名)和端口号 const host = url.hostname // 例如: "192.168.1.100" 或 "localhost" - const port = '8082' // 使用固定的后端端口 + const port = '8082' // 使用固定的后端端口;由于本地开发时,8080被占用导致ws连接失败,所以使用8082 // 构建 WebSocket URL const wsProtocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:'