From 91056e2ec0b1cfd5855a5407fcbdeb5d7bd77690 Mon Sep 17 00:00:00 2001 From: Baobhan Sith <80159437+Heavrnl@users.noreply.github.com> Date: Sun, 25 May 2025 23:08:29 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E6=94=B6=E8=97=8F=E5=8A=A0=E8=BD=BD=E9=94=99=E8=AF=AF=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/frontend/src/App.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/frontend/src/App.vue b/packages/frontend/src/App.vue index ba8b6f6..cea449b 100644 --- a/packages/frontend/src/App.vue +++ b/packages/frontend/src/App.vue @@ -80,9 +80,16 @@ onMounted(() => { // +++ 加载 Header 可见性状态 +++ layoutStore.loadHeaderVisibility(); - favoritePathsStore.initializeFavoritePaths(t); // +++ 初始化收藏路径数据 +++ + }); +// +++ 监听用户认证状态,登录后初始化收藏路径 +++ +watch(isAuthenticated, (loggedIn) => { + if (loggedIn) { + favoritePathsStore.initializeFavoritePaths(t); + } +}, { immediate: true }); + // +++ 卸载钩子以移除监听器 +++ onUnmounted(() => { window.removeEventListener('keydown', handleAltKeyDown); // +++ 移除 keydown 监听 +++