From e484ded5bee62a92030c071bc8b26e4e59a0a996 Mon Sep 17 00:00:00 2001 From: yyc12345 Date: Fri, 15 May 2026 09:39:15 +0800 Subject: [PATCH] feat: add logout for navbar --- frontend/src/App.vue | 108 +++++++++++++++++++++++------------ frontend/src/stores/token.ts | 1 + frontend/src/views/Login.vue | 2 +- 3 files changed, 73 insertions(+), 38 deletions(-) diff --git a/frontend/src/App.vue b/frontend/src/App.vue index eed4a81..01fdf47 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -1,58 +1,92 @@ diff --git a/frontend/src/stores/token.ts b/frontend/src/stores/token.ts index af4ce2c..0bc8876 100644 --- a/frontend/src/stores/token.ts +++ b/frontend/src/stores/token.ts @@ -11,6 +11,7 @@ export const useTokenStore = defineStore('token', { getters: { isLoggedIn: (state) => typeof state.token === 'string', + currentToken: (state) => state.token as string, }, actions: { diff --git a/frontend/src/views/Login.vue b/frontend/src/views/Login.vue index 27b59fb..e311a83 100644 --- a/frontend/src/views/Login.vue +++ b/frontend/src/views/Login.vue @@ -1,7 +1,7 @@