From d94ebfe04cdb034763bc44f20fd6106fa7079e5f Mon Sep 17 00:00:00 2001 From: kuaifan Date: Thu, 18 Dec 2025 08:26:42 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E8=A7=A3=E6=9E=90?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E7=9A=84=E6=96=B9=E6=B3=95=EF=BC=8C=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E5=BE=AE=E5=BA=94=E7=94=A8=E9=85=8D=E7=BD=AE=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../assets/js/components/MicroApps/index.vue | 22 +++++++++++++++++++ resources/assets/js/store/actions.js | 17 +------------- 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/resources/assets/js/components/MicroApps/index.vue b/resources/assets/js/components/MicroApps/index.vue index 6439d07f2..e09e1a3b3 100644 --- a/resources/assets/js/components/MicroApps/index.vue +++ b/resources/assets/js/components/MicroApps/index.vue @@ -404,6 +404,9 @@ export default { } } + // 解析 type 字段 + config.type = this.resolveType(config.type) + // 如果是 blank 链接,则在新窗口打开 if (/_blank$/i.test(config.type)) { await this.inlineBlank(config) @@ -769,6 +772,25 @@ export default { this.closeMicroApp(app.name, true) } }) + }, + + /** + * 解析类型 + * @param type + */ + resolveType(type) { + if (typeof type === 'string') { + return type + } + if ($A.isJson(type)) { + const defaultType = typeof type.default === 'string' ? type.default : 'iframe' + const mobileType = typeof type.mobile === 'string' + ? type.mobile + : (typeof type.app === 'string' ? type.app : defaultType) + const desktopType = typeof type.desktop === 'string' ? type.desktop : defaultType + return $A.platformType() === 'desktop' ? desktopType : mobileType + } + return 'inline' } } } diff --git a/resources/assets/js/store/actions.js b/resources/assets/js/store/actions.js index a9e9eda75..9ffef0ce7 100644 --- a/resources/assets/js/store/actions.js +++ b/resources/assets/js/store/actions.js @@ -5095,26 +5095,11 @@ export default { }) .replace(/\{system_base_url}/g, serverLocation.origin) - const resolveType = () => { - if (typeof data.type === 'string') { - return data.type - } - if ($A.isJson(data.type)) { - const defaultType = typeof data.type.default === 'string' ? data.type.default : 'iframe' - const mobileType = typeof data.type.mobile === 'string' - ? data.type.mobile - : (typeof data.type.app === 'string' ? data.type.app : defaultType) - const desktopType = typeof data.type.desktop === 'string' ? data.type.desktop : defaultType - return $A.platformType() === 'desktop' ? desktopType : mobileType - } - return 'inline' - } - const config = { id: data.id, name: data.name, url: $A.mainUrl(data.url), - type: resolveType(), + type: data.type || data.url_type, background: data.background || null, capsule: $A.isJson(data.capsule) ? data.capsule : {}, transparent: typeof data.transparent == 'boolean' ? data.transparent : false,