chenyc
2025-10-27 c64c31795d1e9ea96671f7e11279af8babecde83
src/samples/node-api.ts
@@ -63,28 +63,17 @@
})
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("网路链接失败")
    ElNotification({
      title: '异常',
      message: '网络已断开,等待重连',
      type: 'warning',
    })
    // console.log("网路链接失败")
    ElMessage.warning('网络已经断开')
  })
},5000)
},10000)
const writeResult=(res: ResultInfo)=>{
  // console.log(`收到设备回传结果:类型=${res.deviceType},结果=${res.result}`)
  ipcRenderer.invoke('logger', `收到设备回传结果:类型=${res.deviceType},结果=${res.result}`)
  switch(res.deviceType){
      case '读卡器':