From c8d8d868acfb15c40e7d8148ee3f7cd84506440c Mon Sep 17 00:00:00 2001 From: 05412 Date: Tue, 20 Aug 2024 14:44:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81=E6=8F=90?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/siteconfig-store.ts | 4 ++-- src/vite-env.d.ts | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/stores/siteconfig-store.ts b/src/stores/siteconfig-store.ts index fb68862..952b394 100644 --- a/src/stores/siteconfig-store.ts +++ b/src/stores/siteconfig-store.ts @@ -7,8 +7,8 @@ interface SiteConfig { export const useSiteConfigStore = defineStore('siteConfigStore', ()=> { const siteConfig = ref({ - protocol: import.meta.env.VITE_PROTOCOL as string, - host: import.meta.env.VITE_HOST as string + protocol: import.meta.env.VITE_PROTOCOL, + host: import.meta.env.VITE_HOST }) return { siteConfig } }) \ No newline at end of file diff --git a/src/vite-env.d.ts b/src/vite-env.d.ts index 11f02fe..be58fc9 100644 --- a/src/vite-env.d.ts +++ b/src/vite-env.d.ts @@ -1 +1,11 @@ /// + +interface ImportMetaEnv { + readonly VITE_PROTOCOL: string, + readonly VITE_HOST: string, + readonly VITE_LOCALE: string, +} + +interface ImportMeta { + readonly env: ImportMetaEnv +} \ No newline at end of file