20 lines
795 B
TypeScript
20 lines
795 B
TypeScript
// Ported from legacy henza_admin/src/utils/index.js
|
|
//
|
|
// Legacy:
|
|
// export function isBranch(){
|
|
// console.log(process.env.NODE_ENV)
|
|
// return process.env.NODE_ENV=='branch'
|
|
// }
|
|
//
|
|
// Vite has no process.env at runtime; the equivalent build-time switch is the
|
|
// --mode flag, exposed as import.meta.env.MODE. Run `pnpm dev:branch` for branch mode.
|
|
// The legacy console.log is intentionally not carried over (debug noise, no behaviour).
|
|
export function isBranch(): boolean {
|
|
return import.meta.env.MODE === 'branch';
|
|
}
|
|
|
|
// Legacy stored the token under a different localStorage key per mode.
|
|
// See henza_admin/src/axios.js:6 and router.js:173-174,188.
|
|
export const tokenName = isBranch() ? 'branch_token' : 'token';
|
|
export const userName = isBranch() ? 'branch_user' : 'user';
|