Browse Source

登陆错误信息提示

master
maochaoying 2 years ago
parent
commit
154b2d8e55
  1. 2
      src/components/LoginForm.vue
  2. 25
      src/store/modules/websocket.js

2
src/components/LoginForm.vue

@ -114,7 +114,7 @@ const handleLogin = () => {
} }
}) })
if (!flag) { if (!flag) {
tip.value = '账号或密码错误'
// tip.value = ''
} }
} }
</script> </script>

25
src/store/modules/websocket.js

@ -180,9 +180,24 @@ export const useWebSocketStore = defineStore({
break break
case 'exportUserBehaviorRecord': case 'exportUserBehaviorRecord':
settingStore.updateExportLoading(false) settingStore.updateExportLoading(false)
const { ackcode } = JSON.parse(ev.data) || {}
if (ackcode == 3000) {
showFailToast('未检测到U盘')
}
if (ackcode != 0 && ackcode != 3000) {
showFailToast('导出错误')
}
break break
case 'exportDisinfectionRecord': case 'exportDisinfectionRecord':
settingStore.updateExportLoading(false) settingStore.updateExportLoading(false)
const { ackcode: disinfectionRecordCode } =
JSON.parse(ev.data) || {}
if (disinfectionRecordCode == 3000) {
showFailToast('未检测到U盘')
}
if (disinfectionRecordCode != 0 && disinfectionRecordCode != 3000) {
showFailToast('导出错误')
}
break break
case 'getAllFormula': case 'getAllFormula':
const { formula } = JSON.parse(ev.data) || {} const { formula } = JSON.parse(ev.data) || {}
@ -202,9 +217,13 @@ export const useWebSocketStore = defineStore({
runningStore.updateDisinfectionConfig(disinfectionConfig) runningStore.updateDisinfectionConfig(disinfectionConfig)
break break
case 'login': 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 break
case 'getAllRecords': case 'getAllRecords':
break break

Loading…
Cancel
Save