fix(conflicts): 解决合并冲突
This commit is contained in:
commit
a1828f75e6
95 files changed
+4636
-476
No files matched your search
@@ -15,6 +15,8 @@ export interface AuthUser {
|
||||
real_name?: string;
|
||||
employee_id?: string;
|
||||
role?: string;
|
||||
role_name?: string;
|
||||
is_platform_admin?: boolean;
|
||||
feature_permissions?: FeaturePermissions;
|
||||
token?: string;
|
||||
access_token?: string;
|
||||
@@ -23,6 +25,17 @@ export interface AuthUser {
|
||||
token_expires_at?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否平台管理员。优先读后端 is_platform_admin;旧登录态缺字段时回退 role=admin。
|
||||
*/
|
||||
export function isPlatformAdminUser(
|
||||
user?: { is_platform_admin?: boolean; role?: string } | null,
|
||||
): boolean {
|
||||
if (!user) return false;
|
||||
if (typeof user.is_platform_admin === 'boolean') return user.is_platform_admin;
|
||||
return String(user.role || '').trim().toLowerCase() === 'admin';
|
||||
}
|
||||
|
||||
interface StoredAuthPayload {
|
||||
user?: AuthUser;
|
||||
expiry?: number;
|
||||
|
||||
Reference in new issue
Block a user