微调
This commit is contained in:
parent
8d926b37cd
commit
5d83a368e0
@ -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',
|
||||
|
@ -165,7 +165,7 @@ onMounted(() => {
|
||||
}
|
||||
document.addEventListener('click', watchInteract);
|
||||
document.addEventListener('keydown', watchInteract);
|
||||
socket = webSocketConnect(socket, destination, handler);
|
||||
socket = webSocketConnect(destination, handler);
|
||||
});
|
||||
|
||||
//模拟报警
|
||||
|
@ -372,7 +372,7 @@ onMounted(() => {
|
||||
setTimeout(() => {
|
||||
tableRef.value.requestServerInteraction();
|
||||
lineNetStore.alarmInfoListTable = tableRef.value;
|
||||
socket = webSocketConnect(socket, destination, handler);
|
||||
socket = webSocketConnect(destination, handler);
|
||||
});
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user