微调
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 { getJwtToken } from 'src/configs/TokenManage';
|
||||||
import { getWebsocketUrl } from 'src/configs/UrlManage';
|
import { getWebsocketUrl } from 'src/configs/UrlManage';
|
||||||
|
|
||||||
export function webSocketConnect(
|
export function webSocketConnect(destination: string, handler: HandleMessage) {
|
||||||
socket: StompMessagingClient | null,
|
const socket = new StompMessagingClient({
|
||||||
destination: string,
|
|
||||||
handler: HandleMessage
|
|
||||||
) {
|
|
||||||
socket = new StompMessagingClient({
|
|
||||||
wsUrl: `${getWebsocketUrl()}`,
|
wsUrl: `${getWebsocketUrl()}`,
|
||||||
token: getJwtToken() as string,
|
token: getJwtToken() as string,
|
||||||
protocol: 'protobuf',
|
protocol: 'protobuf',
|
||||||
|
@ -165,7 +165,7 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
document.addEventListener('click', watchInteract);
|
document.addEventListener('click', watchInteract);
|
||||||
document.addEventListener('keydown', watchInteract);
|
document.addEventListener('keydown', watchInteract);
|
||||||
socket = webSocketConnect(socket, destination, handler);
|
socket = webSocketConnect(destination, handler);
|
||||||
});
|
});
|
||||||
|
|
||||||
//模拟报警
|
//模拟报警
|
||||||
|
@ -372,7 +372,7 @@ onMounted(() => {
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
tableRef.value.requestServerInteraction();
|
tableRef.value.requestServerInteraction();
|
||||||
lineNetStore.alarmInfoListTable = tableRef.value;
|
lineNetStore.alarmInfoListTable = tableRef.value;
|
||||||
socket = webSocketConnect(socket, destination, handler);
|
socket = webSocketConnect(destination, handler);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user