fix: resolve production crash in api-client.ts and frontend.tsx by using env utility

This commit is contained in:
bipproduction
2026-02-07 17:06:36 +08:00
parent 60457b1f2f
commit 5c2bd971d7
3 changed files with 12 additions and 3 deletions

View File

@@ -21,3 +21,11 @@ export const getEnv = (key: string, defaultValue = ""): string => {
};
export const VITE_PUBLIC_URL = getEnv("VITE_PUBLIC_URL", "http://localhost:3000");
export const IS_DEV = (() => {
try {
return typeof import.meta.env !== "undefined" && import.meta.env.DEV;
} catch {
return false;
}
})();