diff --git a/electron/config/bin.js b/electron/config/bin.js index fd43f8d..dfe9a69 100644 --- a/electron/config/bin.js +++ b/electron/config/bin.js @@ -25,18 +25,35 @@ module.exports = { go: { directory: './go', cmd: 'go', - args: ['run', './main.go', '--env=dev', '--basedir=../'], + args: ['run', './main.go', '--env=dev','--basedir=../', '--port=7073', '--ssl=false', '--url=http://127.0.0.1:7073'], }, }, /** - * 前端构建 + * 构建 * ee-bin build */ build: { - directory: './frontend', - cmd: 'npm', - args: ['run', 'build'], + frontend: { + directory: './frontend', + cmd: 'npm', + args: ['run', 'build'], + }, + go_build_w: { + directory: './go', + cmd: 'go', + args: ['build', '-o', '../build/extraResources/goapp.exe'], + }, + go_build_m: { + directory: './go', + cmd: 'go', + args: ['build', '-o', '../build/extraResources/goapp'], + }, + go_build_l: { + directory: './go', + cmd: 'go', + args: ['build', '-o', '../build/extraResources/goapp'], + } }, /** @@ -102,20 +119,20 @@ module.exports = { * ee-bin exec */ exec: { - go_build_w: { + go: { directory: './go', cmd: 'go', - args: ['build', '-o', '../build/extraResources/goapp.exe'], + args: ['run', './main.go', '--env=dev'], }, - go_build_m: { - directory: './go', - cmd: 'go', - args: ['build', '-o goapp', '--env=prod'], + node_v: { + directory: './', + cmd: 'node', + args: ['-v'], + }, + npm_v: { + directory: './', + cmd: 'npm', + args: ['-v'], }, - go_build_l: { - directory: './go', - cmd: 'go', - args: ['build', '-o goapp', '--env=prod'], - } }, }; \ No newline at end of file diff --git a/electron/config/config.default.js b/electron/config/config.default.js index 925f416..99f1ba9 100644 --- a/electron/config/config.default.js +++ b/electron/config/config.default.js @@ -29,7 +29,7 @@ module.exports = (appInfo) => { minWidth: 400, minHeight: 300, webPreferences: { - webSecurity: false, + //webSecurity: false, contextIsolation: false, // false -> 可在渲染进程中使用electron的api,true->需要bridge.js(contextBridge) nodeIntegration: true, //preload: path.join(appInfo.baseDir, 'preload', 'bridge.js'), @@ -123,15 +123,13 @@ module.exports = (appInfo) => { /** * Cross-language service * 跨语言服务 + * 例如:执行go的二进制程序 */ config.cross = { go: { enable: true, name: 'goapp', - args: ['--env=dev'], - protocol: "http://", - hostname: "127.0.0.1", - port: 7073, + args: ['--env=dev', '--port=7073', '--ssl=false', '--url=http://127.0.0.1:7073'], } }; diff --git a/go/config/config.default.json b/go/config/config.default.json index a3a74b8..1c8f6ba 100644 --- a/go/config/config.default.json +++ b/go/config/config.default.json @@ -12,8 +12,7 @@ "hostname": "127.0.0.1", "port": 7073, "index_path": "", - "network": false, - "static_dir": true + "network": false }, "static": { "enable": true, diff --git a/package.json b/package.json index 6fdf9c7..c9ce18a 100644 --- a/package.json +++ b/package.json @@ -8,10 +8,10 @@ "dev-frontend": "ee-bin dev --serve=frontend", "dev-electron": "ee-bin dev --serve=electron", "dev-go": "ee-bin dev --serve=go", - "build-frontend": "ee-bin build", - "build-go-w": "ee-bin exec --command=go_build_w", - "build-go-m": "ee-bin exec --command=go_build_m", - "build-go-l": "ee-bin exec --command=go_build_l", + "build-frontend": "ee-bin build --cmds=frontend", + "build-go-w": "ee-bin build --cmds=go_build_w", + "build-go-m": "ee-bin build --cmds=go_build_m", + "build-go-l": "ee-bin build --cmds=go_build_l", "start": "ee-bin start", "move": "ee-bin move --flag=go_static,go_config,go_package,go_images", "rd": "ee-bin move --flag=frontend_dist",