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) {