diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts index af69678..7594ec5 100644 --- a/frontend/src/router/index.ts +++ b/frontend/src/router/index.ts @@ -81,7 +81,7 @@ router.beforeEach((to, _from, next) => { const token = localStorage.getItem('access_token') const publicPaths = ['/login', '/preview'] const isPublic = Boolean(to.meta.public) || publicPaths.some(p => to.path.startsWith(p)) - document.title = `${to.meta.title || '智教助手'} - 智教助手` + document.title = to.meta.title ? `${to.meta.title} - 智教助手` : '智教助手' if (!isPublic && !token) { next({ path: '/login', query: { redirect: to.fullPath } })