feat(rbac-web): 前端页面级权限与「权限与角色」管理页
- 新增 rbac 的 api/types/mock,对接后端 catalog/roles/users;mock 模式与后端 PageCatalog 完全对齐 - EffectivePermissions 增加 allowedPages,auth store 新增 hasPage 判定 - 路由守卫按 route.name = 页面 Key 做页面级放行,无权时跳转到 scope 内首个可访问页面;AppShell 菜单按 hasPage 过滤 - 路由守卫 switchScope 失败自动重试一次;新增懒加载 chunk 失败整页自愈 onError,修复切页白屏 - PermissionGuard hidden 态改为友好空态提示;AuthRoleView 重写为完整的用户/角色/权限编辑界面
This commit is contained in:
@@ -9,6 +9,7 @@ import { TRACKS } from './data/tracks'
|
||||
import { CARS } from './data/cars'
|
||||
import { MISSIONS } from './data/missions'
|
||||
import { CONFIG_DEFAULTS } from './data/configs'
|
||||
import { mockComputeAllowedPages } from './rbac'
|
||||
|
||||
const PLATFORM_OPS = ['*']
|
||||
|
||||
@@ -26,6 +27,7 @@ function buildPerm(scope: 'Platform' | 'RCSMonitor', username: string): Effectiv
|
||||
userId: `u-${username}`,
|
||||
version: 1,
|
||||
allowedOps: PLATFORM_OPS,
|
||||
allowedPages: mockComputeAllowedPages(username, 'Platform'),
|
||||
visibleWidgets: [
|
||||
{ widgetId: 'MapEditor', visibility: 'interactive' },
|
||||
{ widgetId: 'CadToolbar', visibility: 'interactive' },
|
||||
@@ -40,6 +42,7 @@ function buildPerm(scope: 'Platform' | 'RCSMonitor', username: string): Effectiv
|
||||
userId: `u-${username}`,
|
||||
version: 1,
|
||||
allowedOps: RCS_OPS,
|
||||
allowedPages: mockComputeAllowedPages(username, 'RCSMonitor'),
|
||||
visibleWidgets: [
|
||||
{ widgetId: 'MapEditor', visibility: 'readonly' },
|
||||
{ widgetId: 'CadToolbar', visibility: 'hidden' },
|
||||
|
||||
Reference in New Issue
Block a user