From 027622f5441fb8eeaf28c2e341f63a98255fd996 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Fri, 18 Oct 2024 16:59:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=89=93=E5=8C=85=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/main.js b/main.js index 19a3bd4..a9d298a 100644 --- a/main.js +++ b/main.js @@ -298,7 +298,13 @@ app.on('ready', () => { width: config.width, height: config.height, }) - child.loadURL(config.url) + if (env === 'development') { + // 开发 + child.loadURL(config.url) + } else { + // 测试 | 生产 + child.loadURL(`file://${path.join(__dirname, './dist/index.html')}#/${config.key}`); + } childWindow[config.key] = child child.once('ready-to-show', () => { childWindow[config.key].show()