From f33a54d40153f45054dea519b258bde9efbfd749 Mon Sep 17 00:00:00 2001 From: guoapeng Date: Wed, 9 Jul 2025 21:07:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3socket=E6=96=AD?= =?UTF-8?q?=E5=BC=80=E6=B2=A1=E6=9C=89=E9=87=8D=E6=96=B0=E7=9B=91=E5=90=AC?= =?UTF-8?q?=E6=8E=A8=E9=80=81=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/system.ts | 2 + src/app.vue | 81 +++++++++++++++++++++++---------------- src/assets/images/wifi-unconn.svg | 2 +- src/layouts/default.vue | 3 +- src/libs/socket.ts | 35 ++++++++++++++--- 5 files changed, 82 insertions(+), 41 deletions(-) diff --git a/src/apis/system.ts b/src/apis/system.ts index 0b8bfff..94b8d2b 100644 --- a/src/apis/system.ts +++ b/src/apis/system.ts @@ -20,6 +20,7 @@ export async function sendCmd(resParams: System.SendCmdParams) { return res.rely } else { + console.log(res) throw new Error(res.message) } } @@ -40,6 +41,7 @@ export async function syncSendCmd(resParams: System.SendCmdParams) { export async function subscribeEvent(fromFn: string | '*', callback: (response: Socket.WebSocketResponse) => void) { wsClient.socket.addEventListener('message', (event) => { const data = JSON.parse(event.data) + // console.log(data) if (data.messageType === 'Report' && data.fromFn === fromFn) { callback && callback(data) } diff --git a/src/app.vue b/src/app.vue index 97f7503..3722be8 100644 --- a/src/app.vue +++ b/src/app.vue @@ -1,4 +1,5 @@