diff --git a/src/main.ts b/src/main.ts index 4aba7d93..b3a9da16 100644 --- a/src/main.ts +++ b/src/main.ts @@ -55,7 +55,7 @@ import 'highlight.js/styles/github.css' //导入代码高亮样式 新版 import Logger from '@/utils/Logger' // 本地开发模式 全局引入 element-plus 样式,加快第一次进入速度 -if (isDevMode() == true) { +if (isDevMode()) { import('element-plus/dist/index.css') } diff --git a/src/utils/env.ts b/src/utils/env.ts index 4a45f622..ea271813 100644 --- a/src/utils/env.ts +++ b/src/utils/env.ts @@ -1,6 +1,6 @@ export const isDevMode = () => { const dev = import.meta.env.VITE_DEV - if (dev && dev === true) { + if (dev && dev === 'true') { return true } else { return false diff --git a/types/env.d.ts b/types/env.d.ts index b34d037d..e5861e32 100644 --- a/types/env.d.ts +++ b/types/env.d.ts @@ -11,7 +11,7 @@ interface ImportMetaEnv { readonly VITE_APP_TITLE: string readonly VITE_PORT: number readonly VITE_OPEN: string - readonly VITE_DEV: boolean + readonly VITE_DEV: string readonly VITE_APP_CAPTCHA_ENABLE: string readonly VITE_APP_TENANT_ENABLE: string readonly VITE_BASE_URL: string