From 9d48ca5f1caccaf97d6dba395eb9a5c1b92e715f Mon Sep 17 00:00:00 2001 From: Azir-11 <2075125282@qq.com> Date: Tue, 10 Feb 2026 20:19:25 +0800 Subject: [PATCH] optimize(projects): modify the injection location of the token. --- src/store/modules/auth/index.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/store/modules/auth/index.ts b/src/store/modules/auth/index.ts index ce3327cd..87f0ac03 100644 --- a/src/store/modules/auth/index.ts +++ b/src/store/modules/auth/index.ts @@ -19,7 +19,7 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => { const { toLogin, redirectFromLogin } = useRouterPush(false); const { loading: loginLoading, startLoading, endLoading } = useLoading(); - const token = ref(getToken()); + const token = ref(''); const userInfo: Api.Auth.UserInfo = reactive({ userId: '', @@ -159,9 +159,10 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => { } async function initUserInfo() { - const hasToken = getToken(); + const maybeToken = getToken(); - if (hasToken) { + if (maybeToken) { + token.value = maybeToken; const pass = await getUserInfo(); if (!pass) {