feat: complete admin panel and backend admin api migration

This commit is contained in:
s.esmaeili
2026-09-13 21:02:25 +03:30
parent 03119cd655
commit 267fc7b7d1
239 changed files with 25431 additions and 935 deletions
+19
View File
@@ -0,0 +1,19 @@
// 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';