2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 11:27:17 +08:00

fix: 404时标题为undefined

This commit is contained in:
2025-05-24 22:38:12 +08:00
parent c9d4c79bf8
commit 560b80038e

View File

@@ -6,7 +6,7 @@ import { useThemeStore } from '@/store'
export function createPageTitleGuard(router: Router) {
const themeStore = useThemeStore()
router.afterEach((to) => {
const pageTitle = translateTitle(String(to.meta.title))
const pageTitle = typeof to.meta.title === 'string' ? translateTitle(to.meta.title) : '404'
if (pageTitle) document.title = `${pageTitle} | ${themeStore.name}`
else document.title = themeStore.name
})