mirror of
https://gitee.com/spark-store-project/spark-store
synced 2026-09-20 13:40:11 +08:00
fix(ui): 放大首页标题与启动提示,放开外部链接域名限制
This commit is contained in:
+4
-12
@@ -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 {
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
class="flex flex-1 flex-col items-center justify-center text-slate-500 dark:text-slate-400"
|
||||
>
|
||||
<i class="fas fa-spinner fa-spin text-2xl mb-3"></i>
|
||||
<span class="text-sm">正在加载首页内容…</span>
|
||||
<span class="text-base">正在加载首页内容…</span>
|
||||
</div>
|
||||
<div
|
||||
v-else-if="error"
|
||||
@@ -37,14 +37,14 @@
|
||||
alt="星火应用商店"
|
||||
class="h-32 w-32 mb-6 opacity-90"
|
||||
/>
|
||||
<h1 class="text-sm font-bold text-slate-800 dark:text-slate-200 mb-2">
|
||||
<h1 class="text-2xl font-bold text-slate-800 dark:text-slate-200 mb-2">
|
||||
{{
|
||||
storeFilter === "apm"
|
||||
? "欢迎来到星火应用商店 (Amber PM)"
|
||||
: "欢迎来到星火应用商店"
|
||||
}}
|
||||
</h1>
|
||||
<p class="text-sm text-slate-500 dark:text-slate-400">
|
||||
<p class="text-base text-slate-500 dark:text-slate-400">
|
||||
{{
|
||||
storeFilter === "apm"
|
||||
? "探索丰富的应用,发现更多精彩内容"
|
||||
@@ -57,12 +57,12 @@
|
||||
<!-- ============ 区域1 · 精选(两行网格 4×2,静态不滚动) ============ -->
|
||||
<section class="shrink-0">
|
||||
<div class="mb-4">
|
||||
<h1 class="text-sm font-bold text-slate-800 dark:text-slate-200">
|
||||
<h1 class="text-2xl font-bold text-slate-800 dark:text-slate-200">
|
||||
{{
|
||||
storeFilter === "apm" ? "星火应用商店 (Amber PM)" : "星火应用商店"
|
||||
}}
|
||||
</h1>
|
||||
<p class="text-sm text-slate-500 dark:text-slate-400 mt-0.5">
|
||||
<p class="text-base text-slate-500 dark:text-slate-400 mt-0.5">
|
||||
探索丰富的应用,发现更多精彩内容
|
||||
</p>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user