From 154b2d8e556f7a7d144b7c0123b7aaf4e6e86b03 Mon Sep 17 00:00:00 2001 From: maochaoying <925670706@qq.com> Date: Sun, 10 Sep 2023 16:13:09 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E9=99=86=E9=94=99=E8=AF=AF=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/LoginForm.vue | 2 +- src/store/modules/websocket.js | 25 ++++++++++++++++++++++--- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/components/LoginForm.vue b/src/components/LoginForm.vue index 15505f9..eb4a4a7 100644 --- a/src/components/LoginForm.vue +++ b/src/components/LoginForm.vue @@ -114,7 +114,7 @@ const handleLogin = () => { } }) if (!flag) { - tip.value = '账号或密码错误' + // tip.value = '账号或密码错误' } } diff --git a/src/store/modules/websocket.js b/src/store/modules/websocket.js index 526312e..0c8b424 100644 --- a/src/store/modules/websocket.js +++ b/src/store/modules/websocket.js @@ -180,9 +180,24 @@ export const useWebSocketStore = defineStore({ break case 'exportUserBehaviorRecord': settingStore.updateExportLoading(false) + const { ackcode } = JSON.parse(ev.data) || {} + if (ackcode == 3000) { + showFailToast('未检测到U盘') + } + if (ackcode != 0 && ackcode != 3000) { + showFailToast('导出错误') + } break case 'exportDisinfectionRecord': settingStore.updateExportLoading(false) + const { ackcode: disinfectionRecordCode } = + JSON.parse(ev.data) || {} + if (disinfectionRecordCode == 3000) { + showFailToast('未检测到U盘') + } + if (disinfectionRecordCode != 0 && disinfectionRecordCode != 3000) { + showFailToast('导出错误') + } break case 'getAllFormula': const { formula } = JSON.parse(ev.data) || {} @@ -202,9 +217,13 @@ export const useWebSocketStore = defineStore({ runningStore.updateDisinfectionConfig(disinfectionConfig) break case 'login': - // if (ackcode == 0) { - // window.location.href = 'http://127.0.0.1/' - // } + const { ackcode: loginCode } = JSON.parse(ev.data) || {} + if (loginCode == 50001) { + showFailToast('用户不存在') + } + if (loginCode == 5000) { + showFailToast('密码错误') + } break case 'getAllRecords': break