chenyc
2022-09-16 84e14a34a082e00aa2d47a64ee36398088c12aec
src/samples/node-api.ts
@@ -9,13 +9,14 @@
var internetAvailable = require("internet-available")
import { ElMessage, ElMessageBox } from 'element-plus'
import { on } from 'events'
let deviceList=[]
let clientCode=''
// 主进程发送消息到渲染进程
ipcRenderer.on('main-process-message', (_event, ...args) => {
  console.log('[Receive Main-process message]:', ...args)
})
// 重主进程获取配置项
// 主进程获取配置项完成sockte注册和httpshu
ipcRenderer.on('getConfigData',(_event,...args)=>{
  console.log("config.json",...args)
  if(args[0]===undefined){
@@ -42,6 +43,7 @@
    deviceList=args[1]
    // 建立sockte 通讯
    creatorClient(deviceList,clientCode)
  }
})
ipcRenderer.on("getScreenTimeout",(_event,args)=>{