From 43002533eee6b919d4b968279fa1514dad395728 Mon Sep 17 00:00:00 2001 From: xiaojunnuo Date: Fri, 20 Aug 2021 18:28:08 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BF=AE=E5=A4=8D=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E5=BC=80=E6=9C=BA=E5=90=AF=E5=8A=A8=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/gui/src/background.js | 6 ++++-- packages/gui/src/bridge/auto-start/backend.js | 4 ++-- packages/gui/vue.config.js | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/gui/src/background.js b/packages/gui/src/background.js index cd066d0..6ad0390 100644 --- a/packages/gui/src/background.js +++ b/packages/gui/src/background.js @@ -34,7 +34,7 @@ function setTray (app) { // 系统托盘图标目录 label: '退出', click: () => { - console.log('force quit') + log.info('force quit') forceClose = true quit(app) } @@ -100,7 +100,9 @@ function createWindow () { if (args.hideWindow) { startHideWindow = true } + log.info('start args', args) } + log.info('start hide window', startHideWindow) win = new BrowserWindow({ width: 900, @@ -194,7 +196,7 @@ if (!isFirstInstance) { // Quit when all windows are closed. app.on('window-all-closed', () => { - console.log('window-all-closed') + log.info('window-all-closed') // On macOS it is common for applications and their menu bar // to stay active until the user quits explicitly with Cmd + Q if (process.platform !== 'darwin') { diff --git a/packages/gui/src/bridge/auto-start/backend.js b/packages/gui/src/bridge/auto-start/backend.js index 6d4e362..34c7eef 100644 --- a/packages/gui/src/bridge/auto-start/backend.js +++ b/packages/gui/src/bridge/auto-start/backend.js @@ -28,7 +28,7 @@ export default { install (context) { const { ipcMain, dialog, log, app } = context - const ex = process.execPath + const ex = app.getPath('exe') // 定义事件,渲染进程中直接使用 @@ -44,7 +44,7 @@ export default { openAtLogin: true, path: ex, args: [ - '--process-start-args', '"--hidden"' + '--hideWindow', '"true"' ] }) } diff --git a/packages/gui/vue.config.js b/packages/gui/vue.config.js index f2cb7c8..ce8ad01 100644 --- a/packages/gui/vue.config.js +++ b/packages/gui/vue.config.js @@ -67,8 +67,8 @@ module.exports = { ] }, win: { - icon: 'build/icons/', - requestedExecutionLevel: 'requireAdministrator' + icon: 'build/icons/' + // requestedExecutionLevel: 'highestAvailable' // 加了这个无法开机自启 }, linux: { icon: 'build/mac/',