集成服务端
This commit is contained in:
@@ -1,9 +1,18 @@
|
||||
// electron/electron.js
|
||||
const path = require('path');
|
||||
const { app, BrowserWindow } = require('electron');
|
||||
let exec = require('child_process').exec;
|
||||
|
||||
const isDev = process.env.IS_DEV == "true" ? true : false;
|
||||
|
||||
//计算NMApi路径
|
||||
let NMApiPath = isDev ? '../NMApi.asar' : path.join(process.resourcesPath, 'NMApi.asar')
|
||||
let p = require('path').join(NMApiPath + '/node_modules');
|
||||
require('module').globalPaths.unshift(p); //加入到module的路径列表
|
||||
|
||||
console.log(process.resourcesPath, NMApiPath)
|
||||
const svc = require(NMApiPath + '/app.js')
|
||||
|
||||
function createWindow() {
|
||||
// Create the browser window.
|
||||
const mainWindow = new BrowserWindow({
|
||||
@@ -19,7 +28,7 @@ function createWindow() {
|
||||
// win.loadFile("index.html");
|
||||
mainWindow.loadURL(
|
||||
isDev
|
||||
? 'http://localhost:3000'
|
||||
? 'http://localhost:3301'
|
||||
: `file://${path.join(__dirname, '../dist/index.html')}`
|
||||
);
|
||||
// Open the DevTools.
|
||||
|
||||
Reference in New Issue
Block a user