From f6a5a62990b2a525d349178cb83adf2b8ed8a374 Mon Sep 17 00:00:00 2001 From: maochaoying <925670706@qq.com> Date: Mon, 14 Aug 2023 15:51:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=95=E5=85=A5ws?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Operator.vue | 2 +- src/pages/Home.vue | 3 +- src/pages/Login.vue | 3 +- src/store/modules/websocket.js | 33 +- yarn.lock | 815 +++++++++++++++++++++++------------------ 5 files changed, 497 insertions(+), 359 deletions(-) diff --git a/src/components/Operator.vue b/src/components/Operator.vue index 9117628..4bfa240 100644 --- a/src/components/Operator.vue +++ b/src/components/Operator.vue @@ -98,7 +98,7 @@ const startDisinfect = () => { if (roomSize.value == 0) { showFailToast('请调整房间大小设置,不能为0') } else { - webSocketStore.sendMsg(startDisinfectionJSON) + webSocketStore.sendCommandMsg(startDisinfectionJSON) operatorStore.updateDisinfectStatus(true) props.changeShowOperator(false) } diff --git a/src/pages/Home.vue b/src/pages/Home.vue index c2dd522..092eccd 100644 --- a/src/pages/Home.vue +++ b/src/pages/Home.vue @@ -148,7 +148,8 @@ import Test from 'cpns/Test' import { useOperatorStore, useWebSocketStore } from '@/store' const webSocketStore = useWebSocketStore() -webSocketStore.initSocket() +webSocketStore.initCommandSocket() +webSocketStore.initEventSocket() const showOpertor = ref(true) diff --git a/src/pages/Login.vue b/src/pages/Login.vue index 92abe24..cb98fed 100644 --- a/src/pages/Login.vue +++ b/src/pages/Login.vue @@ -22,7 +22,8 @@ import LoginForm from 'cpns/LoginForm.vue' import { useWebSocketStore } from '@/store' const webSocketStore = useWebSocketStore() -webSocketStore.initSocket() +webSocketStore.initCommandSocket() +webSocketStore.initEventSocket()