This commit is contained in:
joylink_zhaoerwei 2023-12-20 17:41:56 +08:00
parent 8d926b37cd
commit 5d83a368e0
3 changed files with 4 additions and 8 deletions

View File

@ -2,12 +2,8 @@ import { HandleMessage, StompMessagingClient } from 'jl-graphic';
import { getJwtToken } from 'src/configs/TokenManage';
import { getWebsocketUrl } from 'src/configs/UrlManage';
export function webSocketConnect(
socket: StompMessagingClient | null,
destination: string,
handler: HandleMessage
) {
socket = new StompMessagingClient({
export function webSocketConnect(destination: string, handler: HandleMessage) {
const socket = new StompMessagingClient({
wsUrl: `${getWebsocketUrl()}`,
token: getJwtToken() as string,
protocol: 'protobuf',

View File

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

View File

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