Files
lotteryAdmin/src/lib/admin-session-variants.ts
kang a020e34a7d refactor(admin-reports, i18n): remove rebate commission report and enhance localization
Removed the `getAdminReportRebateCommission` function and its references from the admin reports API and localization files. Updated CSS for improved money display handling in admin components. Enhanced localization support by adding new finance and support workspace entries in English, Nepali, and Chinese, improving user experience across the application.
2026-06-16 16:04:03 +08:00

34 lines
1.3 KiB
TypeScript
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.
import type { AdminProfile } from "@/types/api/admin-auth";
/** 绑定代理节点的经营账号(非超管)。 */
export function isAgentOperator(profile: AdminProfile | null | undefined): boolean {
return profile?.agent != null && profile.is_super_admin !== true;
}
/** 任意接入站点平台账号site_admin / site_finance / site_cs。 */
export function isSiteOperator(profile: AdminProfile | null | undefined): boolean {
if (profile?.is_super_admin === true || profile?.agent != null) {
return false;
}
const kind = profile?.account_kind;
return kind === "site_admin" || kind === "site_finance" || kind === "site_cs" || profile?.site != null;
}
/** 站点主运营(满配 site_admin代理页站点方门控仅对此角色放宽。 */
export function isSiteAdminOperator(profile: AdminProfile | null | undefined): boolean {
return profile?.account_kind === "site_admin" || (
profile?.site != null
&& profile?.account_kind == null
&& profile?.is_super_admin !== true
&& profile?.agent == null
);
}
export function isSiteFinanceOperator(profile: AdminProfile | null | undefined): boolean {
return profile?.account_kind === "site_finance";
}
export function isSiteCsOperator(profile: AdminProfile | null | undefined): boolean {
return profile?.account_kind === "site_cs";
}