diff --git a/ElectronJS/config.json b/ElectronJS/config.json index dd18936..252c802 100644 --- a/ElectronJS/config.json +++ b/ElectronJS/config.json @@ -1 +1 @@ -{"webserver_address":"http://localhost","webserver_port":8074,"user_data_folder":"","debug":false,"copyright":1,"sys_version":"x64","mysql_config_path":"./mysql_config.json","absolute_user_data_folder":"/Users/naibo/Documents/EasySpider/ElectronJS/user_data"} \ No newline at end of file +{"webserver_address":"http://localhost","webserver_port":8074,"user_data_folder":"./user_data","debug":false,"copyright":1,"sys_version":"x64","mysql_config_path":"./mysql_config.json","absolute_user_data_folder":"D:\\Documents\\Projects\\EasySpider\\ElectronJS\\user_data"} \ No newline at end of file diff --git a/ElectronJS/main.js b/ElectronJS/main.js index 4ce042a..60874b6 100644 --- a/ElectronJS/main.js +++ b/ElectronJS/main.js @@ -15,6 +15,7 @@ const util = require('util'); let config = fs.readFileSync(path.join(task_server.getDir(), `config.json`), 'utf8'); config = JSON.parse(config); +let config_context = JSON.parse(fs.readFileSync(path.join(task_server.getDir(), `config.json`), 'utf8')); //仅在当前进程中使用,不会写入文件 if (config.debug) { let logPath = 'info.log' @@ -302,7 +303,7 @@ async function beginInvoke(msg, ws) { // It will prompt an accessibility permission request dialog, if needed. if (process.platform != "linux" && process.platform != "darwin") { // 非用户信息模式下,设置窗口位置 - if (config.user_data_folder == null || config.user_data_folder == undefined || config.user_data_folder == "") { + if (config_context.user_data_folder == null || config_context.user_data_folder == undefined || config_context.user_data_folder == "") { const {windowManager} = require("node-window-manager"); const window = windowManager.getActiveWindow(); console.log(window); @@ -815,6 +816,7 @@ function send_message_to_browser(message) { const WebSocket = require('ws'); const {all} = require("express/lib/application"); +const {copy} = require("selenium-webdriver/io"); let wss = new WebSocket.Server({port: websocket_port}); wss.on('connection', function (ws) { ws.on('message', async function (message, isBinary) { @@ -922,9 +924,10 @@ async function runBrowser(lang = "en", user_data_folder = '', mobile = false) { console.log(dir); options.addArguments("--user-data-dir=" + dir); config.user_data_folder = user_data_folder; + config_context.user_data_folder = user_data_folder; fs.writeFileSync(path.join(task_server.getDir(), "config.json"), JSON.stringify(config)); } else { - config.user_data_folder = ""; + config_context.user_data_folder = ""; } if (mobile) { const mobileEmulation = { diff --git a/ElectronJS/server.js b/ElectronJS/server.js index 70113c0..ee324b5 100644 --- a/ElectronJS/server.js +++ b/ElectronJS/server.js @@ -368,9 +368,9 @@ exports.start = function(port = 8074) { res.write(eid.toString(), 'utf8'); res.end(); } else if(pathName == "/getConfig"){ - let config = fs.readFileSync(path.join(getDir(), `config.json`), 'utf8'); - config = JSON.parse(config); - res.write(JSON.stringify(config)); + let config_file = fs.readFileSync(path.join(getDir(), `config.json`), 'utf8'); + config_file = JSON.parse(config_file); + res.write(JSON.stringify(config_file)); res.end(); } else if(pathName == "/setUserDataFolder"){ let config = fs.readFileSync(path.join(getDir(), `config.json`), 'utf8'); diff --git a/ElectronJS/src/taskGrid/FlowChart.html b/ElectronJS/src/taskGrid/FlowChart.html index d6f9768..251026a 100644 --- a/ElectronJS/src/taskGrid/FlowChart.html +++ b/ElectronJS/src/taskGrid/FlowChart.html @@ -29,9 +29,7 @@ @@ -586,6 +584,12 @@ If the expression returns a value greater than 0 or evaluates to True, the loop + +
+ + +
+ diff --git a/ElectronJS/src/taskGrid/FlowChart_CN.html b/ElectronJS/src/taskGrid/FlowChart_CN.html index ae897c6..5b85c9a 100644 --- a/ElectronJS/src/taskGrid/FlowChart_CN.html +++ b/ElectronJS/src/taskGrid/FlowChart_CN.html @@ -29,9 +29,7 @@ @@ -146,7 +144,7 @@

使用相对循环内的XPath定位到的元素

- +

@@ -586,8 +584,15 @@ print(emotlib.emoji()) # 使用其中的函数。 + +
+ + +
+ +