socket调整

This commit is contained in:
joylink_zhaoerwei 2023-12-20 17:36:32 +08:00
parent 64569f9b3c
commit 8d926b37cd
3 changed files with 4 additions and 3 deletions

View File

@ -20,8 +20,9 @@ export function webSocketConnect(
socket?.subscribe(destination, handler); socket?.subscribe(destination, handler);
}); });
socket.on('disconnected', () => { socket.on('disconnected', () => {
console.log(6666); console.log('disconnected');
}); });
return socket;
} }
export function closeWebSocketConnect( export function closeWebSocketConnect(

View File

@ -165,7 +165,7 @@ onMounted(() => {
} }
document.addEventListener('click', watchInteract); document.addEventListener('click', watchInteract);
document.addEventListener('keydown', watchInteract); document.addEventListener('keydown', watchInteract);
webSocketConnect(socket, destination, handler); socket = webSocketConnect(socket, destination, handler);
}); });
// //

View File

@ -372,7 +372,7 @@ onMounted(() => {
setTimeout(() => { setTimeout(() => {
tableRef.value.requestServerInteraction(); tableRef.value.requestServerInteraction();
lineNetStore.alarmInfoListTable = tableRef.value; lineNetStore.alarmInfoListTable = tableRef.value;
webSocketConnect(socket, destination, handler); socket = webSocketConnect(socket, destination, handler);
}); });
}); });