gaoshuaixing il y a 3 ans
Parent
commit
3cb8a5c781
4 fichiers modifiés avec 15 ajouts et 10 suppressions
  1. 0 6
      config/plugin.js
  2. 2 2
      electron/config/config.default.js
  3. 12 0
      main.js
  4. 1 2
      package.json

+ 0 - 6
config/plugin.js

@@ -4,12 +4,6 @@
  *Egg插件
  */
 
-// 跨域插件
-exports.cors = {
-  enable: true,
-  package: 'egg-cors',
-};
-
 exports.ejs = {
   enable: true,
   package: 'egg-view-ejs',

+ 2 - 2
electron/config/config.default.js

@@ -35,7 +35,7 @@ module.exports = (appInfo) => {
   config.openDevTools = false;
 
   /* 应用程序顶部菜单 */
-  config.openAppMenu = false;
+  config.openAppMenu = true;
 
   /* 加载loading页 */
   config.loadingPage = true;
@@ -69,7 +69,7 @@ module.exports = (appInfo) => {
 
   /* egg服务 (可选) */
   config.egg = {
-    enable: true, // 是否启用
+    enable: false, // 是否启用
     title: 'ee', // 进程的title属性标识(默认你的应用名称-英文)
     port: 7068,
     hostname: '127.0.0.1',

+ 12 - 0
main.js

@@ -21,6 +21,16 @@ class Main extends Appliaction {
 
   }
 
+  startEggCluster (options) {
+    return new Promise((resolve, reject) => {
+      this.coreLogger.info('[ee-core:EeApp] [startEggCluster] op', options);
+      const startCluster = require('egg-cluster').startCluster;
+      startCluster(options, function(){
+        resolve('success');
+      });
+    });
+  }
+
   /**
    * before app close
    */  
@@ -30,5 +40,7 @@ class Main extends Appliaction {
   }
 }
 
+
+
 new Main();
  

+ 1 - 2
package.json

@@ -100,12 +100,11 @@
   },
   "dependencies": {
     "dayjs": "^1.10.7",
+    "ee-core": "^1.1.3",
     "egg": "^2.33.1",
     "egg-cluster": "^1.27.1",
-    "egg-cors": "^2.2.3",
     "egg-scripts": "^2.15.2",
     "egg-view-ejs": "^2.0.1",
-    "ee-core": "^1.1.0",
     "electron-is": "^3.0.0",
     "lodash": "^4.17.21",
     "unzip-crx-3": "^0.2.0"