diff --git a/frontend/src/router/guard/index.ts b/frontend/src/router/guard/index.ts index efd9f11..d53eb65 100644 --- a/frontend/src/router/guard/index.ts +++ b/frontend/src/router/guard/index.ts @@ -8,14 +8,14 @@ async function checkInstallStatus(): Promise { try { const res = await fetch('/api/install/status') const data = await res.json() - isInstalled = data?.data?.installed || false + isInstalled = data?.data?.installed ?? false installChecked = true return isInstalled } catch { installChecked = true - isInstalled = true - return true + isInstalled = false + return false } } diff --git a/frontend/src/router/routes.ts b/frontend/src/router/routes.ts index e44bed6..72e0557 100644 --- a/frontend/src/router/routes.ts +++ b/frontend/src/router/routes.ts @@ -1,6 +1,15 @@ import type { RouteRecordRaw } from 'vue-router' const routes: RouteRecordRaw[] = [ + { + path: '/install', + name: 'Install', + component: () => import('@/pages/install/index.vue'), + meta: { + title: '安装 - 管理平台', + layout: false, + }, + }, { path: '/', redirect: '/login', diff --git a/frontend/src/utils/env.ts b/frontend/src/utils/env.ts index bc8ef1e..d7fa747 100644 --- a/frontend/src/utils/env.ts +++ b/frontend/src/utils/env.ts @@ -9,10 +9,8 @@ import { z } from 'zod' */ const EnvSchema = z.object({ - // Add your environment variables here, for example: - // VITE_API_BASE_URL: z.string().url(), - VITE_SERVER_API_URL: z.url(), - VITE_SERVER_API_PREFIX: z.string(), + VITE_SERVER_API_URL: z.string().default(''), + VITE_SERVER_API_PREFIX: z.string().default('/api'), VITE_SERVER_API_TIMEOUT: z.coerce.number().default(5000), })