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