diff --git a/frontend/index.html b/frontend/index.html index 06f7b5c..0f8b936 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -5,22 +5,33 @@ - {{.SiteName}} - - - + 加载中... + - + + diff --git a/frontend/src/App.vue b/frontend/src/App.vue index f7300b6..433de34 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -4,8 +4,13 @@ import { ConfigProvider } from 'reka-ui' import Loading from '@/components/loading.vue' import { Toaster } from '@/components/ui/sonner' import { useSystemTheme } from '@/composables/use-system-theme' +import { useSiteSettings } from '@/composables/use-site-settings' useSystemTheme() +const { initSiteSettings } = useSiteSettings() + +// 在应用启动时初始化系统设置 +initSiteSettings() \ No newline at end of file diff --git a/frontend/src/router/guard/index.ts b/frontend/src/router/guard/index.ts index 11f3dc2..c2a7344 100644 --- a/frontend/src/router/guard/index.ts +++ b/frontend/src/router/guard/index.ts @@ -1,4 +1,5 @@ import type { Router } from 'vue-router' +import { useSiteSettings } from '@/composables/use-site-settings' const INSTALL_CACHE_KEY = 'app_installed' const INSTALL_CACHE_EXPIRY = 24 * 60 * 60 * 1000 @@ -93,4 +94,11 @@ export function createRouterGuard(router: Router) { return '/admin' } }) + + // 设置页面标题 + router.afterEach((to) => { + const { siteSettings, getPageTitle } = useSiteSettings() + const pageTitle = to.meta?.title as string | undefined + document.title = getPageTitle(pageTitle) + }) }