ee-core 2.9.0-beta.1 → 2.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cross/index.js CHANGED
@@ -85,6 +85,10 @@ const CrossLanguageService = {
85
85
  // format params
86
86
  let tmpArgs = targetConf.args;
87
87
  let confPort = parseInt(Helper.getValueFromArgv(tmpArgs, 'port'));
88
+ // 某些程序给它传入不存在的参数时会报错
89
+ if (isNaN(confPort) && targetConf.port > 0) {
90
+ confPort = targetConf.port;
91
+ }
88
92
  if (confPort > 0) {
89
93
  // 动态生成port,传入的端口必须为int
90
94
  confPort = await GetPort({ port: confPort });
@@ -27,12 +27,7 @@ class SpawnProcess {
27
27
  _init(options = {}) {
28
28
  const { targetConf, port } = options;
29
29
  this.config = targetConf;
30
-
31
30
  this.port = port;
32
- // 某些程序给它传入不存在的参数时会报错
33
- if (isNaN(port) && targetConf.port > 0) {
34
- this.port = targetConf.port;
35
- }
36
31
 
37
32
  // 该名称如果在childrenMap重复,会被重写
38
33
  this.name = targetConf.name;
@@ -159,6 +154,10 @@ class SpawnProcess {
159
154
  return obj;
160
155
  }
161
156
 
157
+ setPort(port) {
158
+ this.port = parseInt(port);
159
+ }
160
+
162
161
  _generateId() {
163
162
  const rid = Helper.getRandomString();
164
163
  return `node:${this.pid}:${rid}`;
package/ee/eeApp.js CHANGED
@@ -17,6 +17,7 @@ const GetPort = require('../utils/get-port');
17
17
  const UtilsHelper = require('../utils/helper');
18
18
  const HttpClient = require('../httpclient');
19
19
  const Cross = require('../cross');
20
+ const Html = require('../html');
20
21
 
21
22
  class EeApp extends BaseApp {
22
23
  constructor(options = {}) {
@@ -146,7 +147,7 @@ class EeApp extends BaseApp {
146
147
  // 检查 UI serve是否启动,先加载一个boot page
147
148
  if (load == 'url') {
148
149
  // loading page
149
- let lp = path.join(__dirname, '..', 'html', 'boot.html');
150
+ let lp = Html.getFilepath('boot.html');
150
151
  if (electronCfg.hasOwnProperty('loadingPage') && electronCfg.loadingPage != '') {
151
152
  lp = path.join(this.config.homeDir, electronCfg.loadingPage);
152
153
  }
@@ -170,8 +171,8 @@ class EeApp extends BaseApp {
170
171
  count++;
171
172
  }
172
173
 
173
- if (frontendReady == false) {
174
- const bootFailurePage = path.join(__dirname, '..', 'html', 'failure.html');
174
+ if (frontendReady == false && modeInfo.force !== true) {
175
+ const bootFailurePage = Html.getFilepath('failure.html');
175
176
  this.mainWindow.loadFile(bootFailurePage);
176
177
  Log.coreLogger.error(`[ee-core] Please check the ${url} !`);
177
178
  return;
@@ -248,7 +249,7 @@ class EeApp extends BaseApp {
248
249
  }
249
250
  //console.log('count:', count)
250
251
  if (serviceReady == false) {
251
- const bootFailurePage = path.join(__dirname, '..', 'html', 'cross-failure.html');
252
+ const bootFailurePage = Html.getFilepath('cross-failure.html');
252
253
  this.mainWindow.loadFile(bootFailurePage);
253
254
  throw new Error(`[ee-core] Please check cross service [${service}] ${url} !`)
254
255
  }
@@ -331,7 +332,6 @@ class EeApp extends BaseApp {
331
332
  if (!UtilsHelper.fileIsExist(name)) {
332
333
  return
333
334
  }
334
-
335
335
  this.mainWindow.loadFile(name);
336
336
  }
337
337
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ee-core",
3
- "version": "2.9.0-beta.1",
3
+ "version": "2.9.0",
4
4
  "description": "ee core",
5
5
  "main": "index.js",
6
6
  "scripts": {