提交 f7c240a6 authored 作者: caicai's avatar caicai

2

上级 cd9ef4a6
...@@ -164,7 +164,7 @@ class IpcEvents { ...@@ -164,7 +164,7 @@ class IpcEvents {
// 打开某个软件 - 执行命令 // 打开某个软件 - 执行命令
ipcMain.on("openApp", (e, data) => { ipcMain.on("openApp", (e, data) => {
exec(data.execCommand, (error, stdout, stderr)=>{ let workerProcess = exec(data.execCommand, (error, stdout, stderr)=>{
if(error) { if(error) {
console.error(error) console.error(error)
return; return;
...@@ -172,6 +172,10 @@ class IpcEvents { ...@@ -172,6 +172,10 @@ class IpcEvents {
if(stderr) console.error(stderr) if(stderr) console.error(stderr)
if(stdout) console.log(stdout) if(stdout) console.log(stdout)
}); });
// 退出之后的输出
workerProcess.on('close', function (code) {
console.log('退出之后的输出out code:' + code)
})
}) })
// 某个路径转成base64 // 某个路径转成base64
......
class softOpen {
constructor(mainWindow) {
this.mainWindow = mainWindow;
this.store = this.mainWindow.store;
this.openList = [];
}
/* 新增已打开 */
addOpen(data) {
let hasInKey = this.openList.findIndex(v.name == data.name);
// 已经打开
if(hasInKey != -1) return;
this.openList.push(data);
}
/* 移出 已关闭 */
removeOpen(data) {
let hasInKey = this.openList.findIndex(v.name == data.name);
// 找不到已打开
if(hasInKey == -1) return;
this.openList.splice(hasInKey, 1);
}
/* 获取当前打开应用 */
getOpenList() {
return this.openList;
}
/* 是否全部关闭 */
isAllClosed() {
return this.openList.length === 0;
}
}
export default softOpen
\ No newline at end of file
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论