From aed3225e1f63e835fa9d3063020d2ae161d02aa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=9C=E7=AC=99=E6=AD=8C?= <2277317060@qq.com> Date: Fri, 6 Jun 2025 20:03:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=9C=8B=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/App.vue b/src/App.vue index 7a2638a..d7261b6 100644 --- a/src/App.vue +++ b/src/App.vue @@ -12,7 +12,7 @@ import AlmModal from "@/components/AlmModal"; export default { name: "App", - components: {ThemePicker,AlmModal}, + components: {ThemePicker, AlmModal}, metaInfo() { return { title: this.$store.state.settings.dynamicTitle && this.$store.state.settings.title, @@ -25,8 +25,8 @@ export default { return { // WebSocket相关 websocket: null, - websocketUrl: 'ws://10.42.0.1:7181/ws', - // websocketUrl: 'ws://119.45.202.115:7181/ws', + // websocketUrl: 'ws://10.42.0.1:7181/ws', + websocketUrl: 'ws://119.45.202.115:7181/ws', isWebSocketConnected: false, reconnectTimer: null, reconnectAttempts: 0, @@ -95,7 +95,12 @@ export default { // WebSocket接收消息 onWebSocketMessage(event) { try { - const data = JSON.parse(event.data) + const data = JSON.parse(event.data, (key, value, ctx) => { + if (typeof value === 'number' && value > Number.MAX_SAFE_INTEGER) { + return ctx.source; + } + return value; + }) console.log('收到全局WebSocket数据:', data) if (data.deviceParam) {