mirror of
https://github.com/NaiboWang/EasySpider.git
synced 2025-04-22 12:09:35 +08:00
for windows main.js
This commit is contained in:
parent
adcfc95057
commit
c00edfa484
@ -8,7 +8,7 @@ const {rootCertificates} = require('tls');
|
|||||||
const {exit} = require('process');
|
const {exit} = require('process');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const {exec} = require('child_process');
|
const {exec, spawn} = require('child_process');
|
||||||
const iconPath = path.join(__dirname, 'favicon.ico');
|
const iconPath = path.join(__dirname, 'favicon.ico');
|
||||||
const task_server = require(path.join(__dirname, 'server.js'));
|
const task_server = require(path.join(__dirname, 'server.js'));
|
||||||
const util = require('util');
|
const util = require('util');
|
||||||
@ -333,14 +333,13 @@ async function beginInvoke(msg, ws) {
|
|||||||
// });
|
// });
|
||||||
|
|
||||||
let spawn = require("child_process").spawn;
|
let spawn = require("child_process").spawn;
|
||||||
if (process.platform != "darwin" && msg.message.execute_type == 1) {
|
if (process.platform != "darwin" && msg.message.execute_type == 1 && msg.message.id != -1) {
|
||||||
let child_process = spawn(execute_path, parameters);
|
let child_process = spawn(execute_path, parameters);
|
||||||
child_process.stdout.on('data', function (data) {
|
child_process.stdout.on('data', function (data) {
|
||||||
console.log(data.toString());
|
console.log(data.toString());
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
ws.send(JSON.stringify({"config_folder": task_server.getDir() + "/", "easyspider_location": task_server.getEasySpiderLocation()}));
|
|
||||||
}
|
}
|
||||||
|
ws.send(JSON.stringify({"config_folder": task_server.getDir() + "/", "easyspider_location": task_server.getEasySpiderLocation()}));
|
||||||
} else if (msg.type == 6) {
|
} else if (msg.type == 6) {
|
||||||
try{
|
try{
|
||||||
flowchart_window.openDevTools();
|
flowchart_window.openDevTools();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user