From 2d77481d80d79bd77e9454efc227ed43a32b609d Mon Sep 17 00:00:00 2001 From: gaoshuaixing Date: Wed, 3 Jan 2024 17:26:32 +0800 Subject: [PATCH] cross go --- electron/config/bin.js | 5 ----- electron/config/config.local.js | 16 ++++++++++++++++ electron/controller/example.js | 4 ++++ package.json | 2 +- 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/electron/config/bin.js b/electron/config/bin.js index 7aa5c5c..4842216 100644 --- a/electron/config/bin.js +++ b/electron/config/bin.js @@ -23,11 +23,6 @@ module.exports = { args: ['.', '--env=local'], loadingPage: '/public/html/loading.html', }, - go: { - directory: './go', - cmd: 'go', - args: ['run', './main.go', '--env=dev','--basedir=../', '--port=7073'], - }, }, /** diff --git a/electron/config/config.local.js b/electron/config/config.local.js index 69938ca..200510b 100644 --- a/electron/config/config.local.js +++ b/electron/config/config.local.js @@ -25,6 +25,22 @@ module.exports = (appInfo) => { messageLog: true }; + /** + * Cross-language service + * 跨语言服务 + * 如果有cmd参数,则执行该命令,directory也是必须的 + */ + config.cross = { + go: { + enable: true, + name: 'goapp', + cmd: 'go', + directory: './go', + args: ['run', './main.go', '--env=dev','--basedir=../', '--port=7073'], + appExit: true, + } + }; + return { ...config }; diff --git a/electron/controller/example.js b/electron/controller/example.js index 542eb47..1baa7d4 100644 --- a/electron/controller/example.js +++ b/electron/controller/example.js @@ -33,6 +33,10 @@ class ExampleController extends Controller { const goEntity = Cross.getProcByName('goapp'); Log.info('goEntity name:', goEntity.name); + Log.info('goEntity config:', goEntity.config); + + Log.info('goEntity args:', goEntity.getArgsObj()); + // const result1 = await Services.get('example').test('electron'); // Log.info('service result1:', result1); diff --git a/package.json b/package.json index a242f87..dfd107e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ee", - "version": "3.9.0", + "version": "3.10.0", "description": "A fast, desktop software development framework", "main": "main.js", "scripts": {