From 2013d16776b458105f090c01e097e81767564662 Mon Sep 17 00:00:00 2001
From: chenyincheng <501753378@qq.com>
Date: 星期二, 31 一月 2023 13:30:26 +0800
Subject: [PATCH] 45
---
src/samples/node-api.ts | 43 ++++++++++++++++++-------------------------
1 files changed, 18 insertions(+), 25 deletions(-)
diff --git a/src/samples/node-api.ts b/src/samples/node-api.ts
index 51059bd..5342b0f 100644
--- a/src/samples/node-api.ts
+++ b/src/samples/node-api.ts
@@ -2,8 +2,10 @@
import { cwd } from 'process'
import { ipcRenderer } from 'electron'
import {creatorClient} from './sockteStomp'
+import {connect} from './socketClient'
import {sockteStore} from '@/stores/sockteInfo'
import { patientInfoStore } from '@/stores/patient'
+import { confingInfoStore } from '@/stores/StoresConfing'
import os from 'os'
// import internetAvailable from "internet-available"
var internetAvailable = require("internet-available")
@@ -36,32 +38,23 @@
// 主进程获取配置项完成sockte注册和httpshu
ipcRenderer.on('getConfigData',(_event,...args)=>{
console.log("config.json",...args)
- if(args[0]===undefined){
- // alert("配置文件没有写入配置,请检查配置文件 文件路径:"+args[2])
- ElMessageBox.prompt('没有设定客户编号,请输入客户编号并保存', '警告', {
- confirmButtonText: '保存',
- showClose:false,
- showCancelButton:false,
- inputErrorMessage: 'Invalid Email',
- })
- .then(({ value }) => {
- const mode={
- clientCode:value,
- machineName:os.hostname(),
- screenTimeout: 300,
- devices:[]
- }
- ipcRenderer.send('setConfingData',mode)
- })
-
+ if(args!==null){
+ if(args[0]===undefined){
+ console.log('配置文件没有配置')
+ }
+ else if(args.length>0&&args[0].clientCode.length>0){
+ console.log('配置文件读取')
+ clientCode=args[0].clientCode
+ // 建立sockte 通讯
+ deviceList=args[0].deviceList
+ // 存放conging到仓库
+ confingInfoStore().setconfingInfo(args[0])
+ connect()
+ // creatorClient(args[0])
+
+ }
}
- else if(args.length>0&&args[0].length>0){
- clientCode=args[0]
- deviceList=args[1]
- // 建立sockte 通讯
- creatorClient(deviceList,clientCode)
-
- }
+
})
ipcRenderer.on("getScreenTimeout",(_event,args)=>{
if(args!==undefined){
--
Gitblit v1.8.0