From 39659fb479cabf6ca2ec78ac7037138a3635cdc8 Mon Sep 17 00:00:00 2001 From: taojinlong Date: Tue, 28 May 2024 10:12:31 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E4=B8=AD=E5=BF=83=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-frontend/src/websocket/index.ts | 38 +++++++++++------------ 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/core/core-frontend/src/websocket/index.ts b/core/core-frontend/src/websocket/index.ts index 49ea0437c6..3ccc8612fe 100644 --- a/core/core-frontend/src/websocket/index.ts +++ b/core/core-frontend/src/websocket/index.ts @@ -12,24 +12,24 @@ export default { } ] - const socket = new SockJS('http://localhost:8100' + '/websocket' + '?userId=1') - stompClient = Stomp.over(socket) - const heads = { - userId: 1 - } - stompClient.connect( - heads, - res => { - console.log('连接成功: ' + res) - channels.forEach(channel => { - stompClient.subscribe('/user/' + 1 + channel.topic, res => { - res && res.body && eventBus.emit(channel.event, res.body) - }) - }) - }, - error => { - console.log('连接失败: ' + error) - } - ) + // const socket = new SockJS('http://localhost:8100' + '/websocket' + '?userId=1') + // stompClient = Stomp.over(socket) + // const heads = { + // userId: 1 + // } + // stompClient.connect( + // heads, + // res => { + // console.log('连接成功: ' + res) + // channels.forEach(channel => { + // stompClient.subscribe('/user/' + 1 + channel.topic, res => { + // res && res.body && eventBus.emit(channel.event, res.body) + // }) + // }) + // }, + // error => { + // console.log('连接失败: ' + error) + // } + // ) } }