Files
jeecg-boot/jeecgboot-vue3/electron/env.ts
2025-06-25 16:04:02 +08:00

19 lines
361 B
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// 不能直接使用 process.env会报错
export const $ps = process;
export const isDev = !!$ps.env.VITE_DEV_SERVER_URL;
export const $env = getEnv();
function getEnv() {
if (isDev) {
return $ps.env;
}
// 非开发环境,从 JSON 文件中获取环境变量
const env = require('./env.json');
return {
...$ps.env,
...env,
};
}