| | |
| | | }) |
| | | setInterval(function(){ |
| | | // 检查网络状态 |
| | | internetAvailable({ |
| | | domainName: "baidu.com", |
| | | host: '114.114.114.114' |
| | | }).then(()=>{ |
| | | internetAvailable().then(()=>{ |
| | | sockteStore().setnetLink(true) |
| | | |
| | | }).catch(()=>{ |
| | | sockteStore().setnetLink(false) |
| | | ElNotification({ |
| | | title: 'Success', |
| | | message: '网络连接成功', |
| | | type: 'success', |
| | | // console.log("网路链接失败") |
| | | ElMessage.warning('网络已经断开') |
| | | |
| | | }) |
| | | console.log("网路链接失败") |
| | | ElNotification({ |
| | | title: '异常', |
| | | message: '网络已断开,等待重连', |
| | | type: 'warning', |
| | | }) |
| | | }) |
| | | },5000) |
| | | },10000) |
| | | const writeResult=(res: ResultInfo)=>{ |
| | | // console.log(`收到设备回传结果:类型=${res.deviceType},结果=${res.result}`) |
| | | ipcRenderer.invoke('logger', `收到设备回传结果:类型=${res.deviceType},结果=${res.result}`) |
| | | switch(res.deviceType){ |
| | | case '读卡器': |