feat: implement clean global cross-organization permission node and backend service isolation logic

This commit is contained in:
DXC
2026-04-17 08:59:55 +08:00
parent 477da7c434
commit bd93a3d70b
2 changed files with 31 additions and 5 deletions

View File

@ -203,9 +203,26 @@ const fetchTree = async () => {
try {
const res: any = await getAllPermissionTree()
if (res.code === 200) {
rawTreeData.value = res.data
// 初始化表格结构(此时没有勾选状态)
tableData.value = transformData(res.data)
// --- 注入全局特权虚拟节点 ---
const globalNode = {
id: 99999, // 虚拟ID
name: '🌍 全局系统特权',
code: 'global_privileges',
type: 'menu',
children: [
{
id: 999991,
name: '跨组织/跨区域数据查询',
code: 'global:cross_company',
type: 'element'
}
]
};
// 将虚拟节点放在最前面,然后交给 transformData 处理
const rawData = [globalNode, ...(res.data || [])];
rawTreeData.value = rawData;
tableData.value = transformData(rawData);
}
} catch (e) {
ElMessage.error('加载权限配置失败')