fix some for iam

This commit is contained in:
Montech
2026-10-07 16:45:36 +03:30
parent a72fa607a5
commit 5223de313a
25 changed files with 823 additions and 38 deletions
+7
View File
@@ -15,5 +15,12 @@ export function isBranch(): boolean {
// Legacy stored the token under a different localStorage key per mode.
// See henza_admin/src/axios.js:6 and router.js:173-174,188.
/** آدرس همین پنل، با پیشوند /branch در حالت شعبه. */
export function iamAppUrl(path: string) {
const base = import.meta.env.BASE_URL || '/';
const prefix = base.endsWith('/') ? base : `${base}/`;
return `${window.location.origin}${prefix}${path.replace(/^\//, '')}`;
}
export const tokenName = isBranch() ? 'branch_token' : 'token';
export const userName = isBranch() ? 'branch_user' : 'user';