|
@@ -58,11 +58,11 @@ let loadingWindow
|
|
|
//设置访问路径
|
|
|
//打包访问的路径
|
|
|
|
|
|
-// let serveUrl = "./resources/exe"
|
|
|
-// let serveUrlJar = '\\resources\\exe'
|
|
|
+let serveUrl = "./resources/exe"
|
|
|
+let serveUrlJar = '\\resources\\exe'
|
|
|
//本地访问的路径
|
|
|
-let serveUrl = "./exe"
|
|
|
-let serveUrlJar = '\\exe'
|
|
|
+// let serveUrl = "./exe"
|
|
|
+// let serveUrlJar = '\\exe'
|
|
|
/**
|
|
|
* Set `__static` path to static files in production
|
|
|
* https://simulatedgreg.gitbooks.io/electron-vue/content/en/using-static-assets.html
|
|
@@ -363,6 +363,27 @@ const starServer = function () {
|
|
|
}
|
|
|
|
|
|
|
|
|
+const starBluetoothServer = function () {
|
|
|
+ let syncData = cmd.runSync('netstat -ano|findstr 8000')
|
|
|
+ if (syncData.data === null || syncData.data.trim().toUpperCase().indexOf('LISTENING') <= 0) {
|
|
|
+ let cp = require('child_process')
|
|
|
+ //execFile('./resources/exe/rpc_thrift.exe', function (err, data) {
|
|
|
+ // cp.spawn(serveUrl +'/rpc_thrift.exe', [])
|
|
|
+ let path = process.cwd() + serveUrlJar+'/ct1';
|
|
|
+ cp.spawn('start', ['/b', 'blueMain.exe'], { cwd: path, shell: true, windowsHide: true })
|
|
|
+ do {
|
|
|
+ syncData = cmd.runSync('netstat -ano|findstr 8000')
|
|
|
+ // console.log('find')
|
|
|
+ } while (syncData.data === null || syncData.data.trim().toUpperCase().indexOf('LISTENING') <= 0)
|
|
|
+ console.log('OK')
|
|
|
+ } else {
|
|
|
+ console.log('8000')
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+starBluetoothServer();
|
|
|
+
|
|
|
+
|
|
|
|
|
|
// 配置thrift的connection信息
|
|
|
// eslint-disable-next-line no-undef
|
|
@@ -481,6 +502,13 @@ ipcMain.on('window-close', function () {
|
|
|
stopPid(syncData)
|
|
|
}
|
|
|
}
|
|
|
+ let syncBlueData = cmd.runSync("netstat -ano|findstr 8000");
|
|
|
+ //在的话判断是不是已经启动了是不是listening
|
|
|
+ if (syncBlueData.data != null) {
|
|
|
+ if (syncBlueData.data.includes("LISTENING")) {
|
|
|
+ stopPid(syncBlueData)
|
|
|
+ }
|
|
|
+ }
|
|
|
wssSwitch = false
|
|
|
cmd.runSync('taskkill /f /im javaw.exe')
|
|
|
app.quit()
|