From de4c3abb3a3fdab9dfbdbd32932b33a691cc4a1e Mon Sep 17 00:00:00 2001 From: gaoshuaixing Date: Tue, 14 Jan 2025 15:33:38 +0800 Subject: [PATCH] chore: dev tools --- electron/service/os/window.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/electron/service/os/window.js b/electron/service/os/window.js index c00c710..3b3fb34 100644 --- a/electron/service/os/window.js +++ b/electron/service/os/window.js @@ -3,7 +3,7 @@ const path = require('path'); const { BrowserWindow, Notification } = require('electron'); const { getMainWindow } = require('ee-core/electron'); -const { isProd, getBaseDir } = require('ee-core/ps'); +const { isDev, isProd, getBaseDir } = require('ee-core/ps'); const { getConfig } = require('ee-core/config'); const { isFileProtocol } = require('ee-core/utils'); const { logger } = require('ee-core/log'); @@ -60,7 +60,10 @@ class WindowService { const win = new BrowserWindow(opt); const winContentsId = win.webContents.id; win.loadURL(contentUrl); - win.webContents.openDevTools(); + if (isDev()) { + win.webContents.openDevTools(); + } + this.windows[windowName] = win; return winContentsId;