环境变量与修复debugger一个键

This commit is contained in:
洛洛希雅Lolosia 2023-08-02 09:43:03 +08:00
parent 1d9a65387e
commit 96557fb255
2 changed files with 4 additions and 2 deletions

View File

@ -3,6 +3,7 @@ import { defineStore } from 'pinia'
export const useDebuggerStore = defineStore('debugger', { export const useDebuggerStore = defineStore('debugger', {
state() { state() {
return { return {
enable: import.meta.env.VITE_APP_ENV !== 'prod',
ui: { ui: {
showLayoutGrid: false showLayoutGrid: false
} }

5
typings/env.d.ts vendored
View File

@ -1,8 +1,9 @@
declare global { declare global {
interface ImportMetaEnv { interface ImportMetaEnv {
readonly VITE_APP_BASE_MODE: 'local' | 'url' | 'port'
readonly VITE_APP_BASE_URL: string readonly VITE_APP_BASE_URL: string
readonly VITE_APP_IMAGE_URL: string readonly VITE_APP_BASE_PORT: number
readonly VITE_APP_ENV: string readonly VITE_APP_ENV: 'prod' | 'test' | 'dev'
// 更多环境变量... // 更多环境变量...
} }
interface ImportMeta { interface ImportMeta {