From cf6f6041b693af8d83fd24e12d52da853184bb67 Mon Sep 17 00:00:00 2001 From: kuaifan Date: Sun, 14 Jun 2026 05:30:31 +0000 Subject: [PATCH] =?UTF-8?q?fix(micro-app):=20=E6=B5=8F=E8=A7=88=E5=99=A8?= =?UTF-8?q?=E7=8B=AC=E7=AB=8B=E7=AA=97=E5=8F=A3(popout)=E5=85=B3=E9=97=AD?= =?UTF-8?q?=E5=BA=94=E7=94=A8=E6=97=B6=E5=85=B3=E9=97=AD=E7=AA=97=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit assistShow watch 此前只为 Electron 子窗口发送 windowDestroy 销毁窗口, 浏览器以 window.open 打开的 popout 独立窗口(single/apps.vue)关闭应用后 只隐藏内容、窗口空挂不关。补全浏览器分支:windowType 为 popout 时调用 window.close()。主程序内嵌的 embed 窗口(默认值)不进入此分支,不受影响。 Co-Authored-By: Claude Opus 4.8 (1M context) --- resources/assets/js/components/MicroApps/index.vue | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/resources/assets/js/components/MicroApps/index.vue b/resources/assets/js/components/MicroApps/index.vue index 4d2d8e742..814adbf7f 100644 --- a/resources/assets/js/components/MicroApps/index.vue +++ b/resources/assets/js/components/MicroApps/index.vue @@ -161,9 +161,17 @@ export default { this.unmountAllMicroApp() }, assistShow(show) { - if (!show && $A.isSubElectron && !this.isRestarting) { - // 如果是子 Electron 窗口,关闭窗口助理时销毁窗口(但是重启过程中不销毁) + if (show || this.isRestarting) { + // 仍有应用打开,或正在重启过程中,都不销毁窗口 + return + } + if ($A.isSubElectron) { + // 如果是子 Electron 窗口,关闭窗口助理时销毁窗口 $A.Electron.sendMessage('windowDestroy'); + } else if (this.windowType === 'popout') { + // 浏览器独立窗口(window-type="popout",由 window.open 打开):关闭浏览器窗口 + // 注意:仅 popout 生效,主程序内嵌的 embed 窗口(默认值)不会进入此分支 + window.close(); } }, microApps: {