修复登录问题,sidebar修复用户角色的问题

This commit is contained in:
2025-07-28 10:56:59 +08:00
parent 46febb97cb
commit 6727d62272
7 changed files with 43 additions and 35 deletions
+3 -3
View File
@@ -598,16 +598,16 @@ function buildMenuTreeFromRoutes(routes: RouteInfo[]): MenuItem[] {
/**
* 根据用户角色映射到权限系统的角色标识
* @param userRole 前端用户角色 ('common' | 'developer')
* @param userRole 前端用户角色 ('common' | 'admin' | 'deptLeader' | 'groupLeader')
* @returns 数据库中的角色标识
*/
export function mapUserRoleToRoleKey(userRole: string): string {
const roleMapping: Record<string, string> = {
'common': 'common',
'developer': 'admin',
'admin': 'admin',
'deptLeader': 'deptLeader',
'groupLeader': 'groupLeader'
};
return roleMapping[userRole] || 'common';
return roleMapping[userRole];
}