From 7b52f5489eb1382681e7771ccb7436e2fa9af9bc Mon Sep 17 00:00:00 2001 From: chutingting Date: Tue, 12 Dec 2023 20:17:01 +0800 Subject: [PATCH] edit title --- src/router/index.ts | 2 +- src/views/login/index.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/router/index.ts b/src/router/index.ts index 386d28f..136f51a 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -220,7 +220,7 @@ const router = createRouter({ scrollBehavior: () => ({ behavior: "smooth", left: 0, top: 0 }), }); router.beforeEach((to, from) => { - document.title = 'Metavatar-' + (to.query.p || from.query.p || localStorage.getItem("title") || '') + document.title = 'Metavatar-' + (to.query.p || from.query.p || localStorage.getItem("title") || '慧影') }) /** * 重置路由 diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 2ee4c9e..0ae2a6c 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -822,7 +822,7 @@ const router = useRouter(); /** * 获取页面标题 */ -const title = ref(route.query.p || '') +const title = ref(route.query.p || '慧影') if (title) { localStorage.setItem("title", title.value) document.title = 'Metavatar-' + title.value