diff --git a/frontend/src/pages/install/index.vue b/frontend/src/pages/install/index.vue index 530a1bb..80873f0 100644 --- a/frontend/src/pages/install/index.vue +++ b/frontend/src/pages/install/index.vue @@ -4,6 +4,8 @@ import { computed, onMounted, ref } from 'vue' import { useRouter } from 'vue-router' import { toast } from 'vue-sonner' +import { resetInstallCheck } from '@/router/guard/index' + const router = useRouter() const loading = ref(false) @@ -42,7 +44,8 @@ async function checkInstallStatus() { const data = await res.json() installStatus.value = data?.data if (data?.data?.installed) { - window.location.href = '/login' + resetInstallCheck() + router.push('/login') } } catch (error) { @@ -162,7 +165,8 @@ function goNext() { } function goLogin() { - window.location.href = '/login' + resetInstallCheck() + router.push('/login') } onMounted(() => { diff --git a/frontend/src/router/guard/index.ts b/frontend/src/router/guard/index.ts index d53eb65..a4123e6 100644 --- a/frontend/src/router/guard/index.ts +++ b/frontend/src/router/guard/index.ts @@ -3,6 +3,11 @@ import type { Router } from 'vue-router' let installChecked = false let isInstalled = false +export function resetInstallCheck() { + installChecked = false + isInstalled = false +} + async function checkInstallStatus(): Promise { if (installChecked) return isInstalled try {