diff --git a/src/jlgraphic/message/BasicMessageClient.ts b/src/jlgraphic/message/BasicMessageClient.ts index f63d55a..9d3690e 100644 --- a/src/jlgraphic/message/BasicMessageClient.ts +++ b/src/jlgraphic/message/BasicMessageClient.ts @@ -127,10 +127,9 @@ export class SubscriptionClient { trySubscribe(): void { if (this.mc.connected) { - this.unsubscriptor = this.mc.subscribe( - this.destination, - this.handleMessage - ); + this.unsubscriptor = this.mc.subscribe(this.destination, () => { + this.handleMessage; + }); } } diff --git a/src/jlgraphic/message/MessageBroker.ts b/src/jlgraphic/message/MessageBroker.ts index 1e4a3d6..6aed080 100644 --- a/src/jlgraphic/message/MessageBroker.ts +++ b/src/jlgraphic/message/MessageBroker.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ import EventEmitter from 'eventemitter3'; import { GraphicApp } from '../app'; import { GraphicState } from '../core'; diff --git a/src/layouts/DrawLayout.vue b/src/layouts/DrawLayout.vue index cece667..6587727 100644 --- a/src/layouts/DrawLayout.vue +++ b/src/layouts/DrawLayout.vue @@ -170,14 +170,15 @@ onMounted(() => { onResize(); drawApp.enableWsMassaging({ engine: ClientEngine.Centrifugo, - protocol: 'json', + // protocol: 'json', wsUrl: getWebsocketUrl(), token: // 'Bearer eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJzZWxmIiwic3ViIjoiNiIsImV4cCI6MTY5MDc5MDczMSwiaWF0IjoxNjkwNTMxNTMxfQ.caXc0jfI766p57Qx6hnuMp6XPpnBvfQuBeFI5-mlOHLBEK6Js13jy0cfGX_FxICWUGEEV0lYI8U1EfCDYPyQ38i4BcHe88mq4jK6byztuyWtkWjx4nOMcCwO-haOfJ2E0pIJOOm5aFBWT2YRdlb63gjvDbyLwdsvO1wr4-QSkB2uyyKpTaFnYP4OiF264UdN-XYuME5k_RkjcinvcYjPR7WI2YCu_Sg0exzqQW03pspTyx5ozbuc_3JSkOA7g4aqnizMJgVAsCbTwYBnfvLClDbcztkyaqbhN5pA4Eme_yPos4ISfufjR7TyUROVp7yEV6gSLHRtPulageQxNhltXA', - 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2OTA2MTM0MzUsImlkIjo2LCJvcmlnX2lhdCI6MTY5MDUyNzAzNSwic3ViIjoiNiJ9.sRCFji8-90hXK_l_O2ScQHYSpmnw8TILmrZGCyR9RCo', + 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2OTA5NjU5MDYsImlkIjo2LCJvcmlnX2lhdCI6MTY5MDk2MjMwNiwic3ViIjoiNiJ9.AeSBdG20_3qP0QeeOcMbcKUqjHkr5BIZvPCs4YvGmFA', }); + const simulationId = 57; drawApp.subscribe({ - destination: '/queue/lineNet', + destination: `simulation-${simulationId}-devices-status`, messageHandle: (msg) => { // const storage = graphicData.RtssGraphicStorage.deserialize(msg); console.log('设备消息处理', msg);