From d35d27d19702bd646ad276a1f2df2964691f382b Mon Sep 17 00:00:00 2001 From: xingyuv Date: Tue, 7 Mar 2023 10:01:29 +0800 Subject: [PATCH] fix: devmode --- src/main.ts | 2 +- src/utils/env.ts | 2 +- types/env.d.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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