From d5d32038f567389f85a88516d41b1fe2a083376c Mon Sep 17 00:00:00 2001 From: kuaifan Date: Sat, 19 Jul 2025 10:38:59 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E5=BA=94=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../assets/js/components/MicroApps/index.vue | 17 +++++++++-------- resources/assets/js/store/mutations.js | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/resources/assets/js/components/MicroApps/index.vue b/resources/assets/js/components/MicroApps/index.vue index d15edda20..eb6decfec 100644 --- a/resources/assets/js/components/MicroApps/index.vue +++ b/resources/assets/js/components/MicroApps/index.vue @@ -115,6 +115,10 @@ export default { }, created() { + // 卸载所有微应用(防止刷新导致的缓存) + microApp.unmountAllApps({destroy: true}) + + // 初始化微应用 microApp.start({ 'iframe': true, 'router-mode': 'state', @@ -137,10 +141,10 @@ export default { if (token) { return } - this.closeAllMicroApp() + this.unmountAllMicroApp() }, themeName() { - this.closeAllMicroApp() + this.unmountAllMicroApp() }, microApps: { handler(items) { @@ -477,15 +481,12 @@ export default { }, /** - * 关闭所有微应用 - * @param destroy + * 卸载所有微应用 */ - closeAllMicroApp(destroy = true) { + unmountAllMicroApp() { this.microApps.forEach(app => { app.isOpen = false - if (destroy) { - this.unmountMicroApp(app) - } + this.unmountMicroApp(app) }); }, diff --git a/resources/assets/js/store/mutations.js b/resources/assets/js/store/mutations.js index ac5003add..cb5f31a29 100644 --- a/resources/assets/js/store/mutations.js +++ b/resources/assets/js/store/mutations.js @@ -344,7 +344,7 @@ export default { location: "application/admin", label: $A.L("应用商店"), icon: $A.mainUrl("images/application/appstore.svg"), - url: 'appstore/internal', + url: 'appstore/internal?language={system_lang}&theme={system_theme}', only_admin: true, disable_scope_css: true, auto_dark_theme: false,