From 86895269c34c0e3a2c40e2b6645c97b19031f7ff Mon Sep 17 00:00:00 2001 From: shenmo Date: Wed, 19 Aug 2026 22:06:10 +0800 Subject: [PATCH] =?UTF-8?q?fix(ui):=20=E6=94=BE=E5=A4=A7=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E6=A0=87=E9=A2=98=E4=B8=8E=E5=90=AF=E5=8A=A8=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=EF=BC=8C=E6=94=BE=E5=BC=80=E5=A4=96=E9=83=A8=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=E5=9F=9F=E5=90=8D=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- electron/main/index.ts | 16 ++++------------ src/components/HomeView.vue | 10 +++++----- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/electron/main/index.ts b/electron/main/index.ts index 6f5a7a53..56818173 100644 --- a/electron/main/index.ts +++ b/electron/main/index.ts @@ -506,21 +506,13 @@ async function createWindow() { logger.info("Renderer process is ready."); }); - // 仅允许可信域名的 https 链接通过浏览器打开,避免钓鱼/恶意站。 - // 协议前缀 + 域名后缀白名单双重校验;非法/无效 URL 一律拒绝。 - const ALLOWED_EXTERNAL_HOSTS = [ - "spark-app.store", - "gitee.com", - "bbs.spark-app.store", - "spark-app.cn", - ]; + // 外部链接统一交给系统默认浏览器打开。 + // 仅限制协议为 http/https,避免 file:/javascript: 等危险协议被打开; + // 不再限制域名,保证应用官网与首页推荐的任意链接均可正常访问。 mainWindow.webContents.setWindowOpenHandler(({ url }) => { try { const parsed = new URL(url); - if ( - parsed.protocol === "https:" && - ALLOWED_EXTERNAL_HOSTS.some((h) => parsed.hostname === h || parsed.hostname.endsWith(`.${h}`)) - ) { + if (parsed.protocol === "http:" || parsed.protocol === "https:") { shell.openExternal(url); } } catch { diff --git a/src/components/HomeView.vue b/src/components/HomeView.vue index 61c785c1..5f703c2a 100644 --- a/src/components/HomeView.vue +++ b/src/components/HomeView.vue @@ -12,7 +12,7 @@ class="flex flex-1 flex-col items-center justify-center text-slate-500 dark:text-slate-400" > - 正在加载首页内容… + 正在加载首页内容…
-

+

{{ storeFilter === "apm" ? "欢迎来到星火应用商店 (Amber PM)" : "欢迎来到星火应用商店" }}

-

+

{{ storeFilter === "apm" ? "探索丰富的应用,发现更多精彩内容" @@ -57,12 +57,12 @@

-

+

{{ storeFilter === "apm" ? "星火应用商店 (Amber PM)" : "星火应用商店" }}

-

+

探索丰富的应用,发现更多精彩内容