From c9b57853016ffc09390bab1e105de28d876d2374 Mon Sep 17 00:00:00 2001 From: Zhang Jing Xuan <17660634225@163.com> Date: Fri, 31 Jul 2026 17:34:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=A0=87=E9=A2=98=E9=87=8D=E5=A4=8D=E6=98=BE=E7=A4=BA=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将 document.title 从 ' - 智教助手' 改为条件判断, 首页等无标题页面只显示'智教助手',其他页面显示'标题 - 智教助手' --- frontend/src/router/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 } })