fix: 修复版本号导入 Vite serving allow list 错误

This commit is contained in:
CHE LIANG ZHAO
2026-01-26 16:22:27 +08:00
parent 61d26fc971
commit ab9aab7beb
2 changed files with 6 additions and 3 deletions

3
web/src/lib/version.ts Normal file
View File

@@ -0,0 +1,3 @@
// 版本号配置
// 更新版本时需要手动修改此文件
export const VERSION = '1.3.0';

View File

@@ -27,8 +27,8 @@
import Sparkles from '@lucide/svelte/icons/sparkles'; import Sparkles from '@lucide/svelte/icons/sparkles';
import Info from '@lucide/svelte/icons/info'; import Info from '@lucide/svelte/icons/info';
// 从 package.json 导入版本号 // 版本号
import pkg from '../../package.json'; import { VERSION } from '$lib/version';
// Theme // Theme
import { import {
@@ -248,7 +248,7 @@
title="查看更新日志" title="查看更新日志"
> >
<Info class="size-4" /> <Info class="size-4" />
<span class="text-xs">v{pkg.version}</span> <span class="text-xs">v{VERSION}</span>
</button> </button>
{/snippet} {/snippet}
</Sidebar.MenuButton> </Sidebar.MenuButton>