From f33d9a4db3d9d1b7956153cbf42d3e506301fddd Mon Sep 17 00:00:00 2001 From: he wei <858544502@qq.com> Date: 星期六, 19 三月 2022 11:16:06 +0800 Subject: [PATCH] U 导出时添加实际容量的图 --- src/main/demo/src/background.js | 15 +++++++++------ 1 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/main/demo/src/background.js b/src/main/demo/src/background.js index 31b7644..53d8c5c 100644 --- a/src/main/demo/src/background.js +++ b/src/main/demo/src/background.js @@ -19,7 +19,7 @@ let pathArr = app.getPath('exe').split('\\'); pathArr.length = pathArr.length - 1; let path = pathArr.join('\\'); - require('child_process').spawn('cmd.exe', ['/c', 'echo '+path+' > 123.txt']); + // require('child_process').spawn('cmd.exe', ['/c', 'echo '+path+' > 123.txt']); serverProcess = require('child_process').spawn('cmd.exe', ['/c', 'testElectronJ.bat'], { cwd: path + '/bundled/bin' @@ -34,12 +34,15 @@ })) } } -// Menu.setApplicationMenu(null); +if (!isDevelopment) { + Menu.setApplicationMenu(null); +} async function createWindow() { // Create the browser window. const win = new BrowserWindow({ width: 800, height: 600, + icon: `${__static}/icon/1.png`, webPreferences: { webSecurity: false, // Use pluginOptions.nodeIntegration, leave this alone @@ -64,7 +67,7 @@ if (process.env.WEBPACK_DEV_SERVER_URL) { // Load the url of the dev server if in development mode await win.loadURL(process.env.WEBPACK_DEV_SERVER_URL) - if (!process.env.IS_TEST) win.webContents.openDevTools() + // if (!process.env.IS_TEST) win.webContents.openDevTools() } else { createProtocol('app') // Load the index.html when not in development @@ -105,7 +108,7 @@ const startUp = function () { const requestPromise = require('minimal-request-promise') requestPromise.get(appUrl).then(function (response) { - require('child_process').spawn('cmd.exe', ['/c', 'echo '+JSON.stringify(response)+' success >> 123.txt']) + // require('child_process').spawn('cmd.exe', ['/c', 'echo '+JSON.stringify(response)+' success >> 123.txt']) console.log(response); console.log('Server started!'); createWindow(); @@ -113,7 +116,7 @@ }, function (response) { console.log(response) console.log('Waiting for the server start...'); - require('child_process').spawn('cmd.exe', ['/c', 'echo '+JSON.stringify(response)+' error >> 123.txt']) + // require('child_process').spawn('cmd.exe', ['/c', 'echo '+JSON.stringify(response)+' error >> 123.txt']) setTimeout(function () { startUp() }, 500) @@ -121,7 +124,7 @@ } app.on('ready', async () => { - require('child_process').spawn('cmd.exe', ['/c', 'echo ready >> 123.txt']) + // require('child_process').spawn('cmd.exe', ['/c', 'echo ready >> 123.txt']) startUp() }) // Exit cleanly on request from parent process in development mode. -- Gitblit v1.9.1