lvfengfree b92e1119ae fix: 修复菜单为空问题 - 移除后端过滤home路由的错误逻辑
- 修复RouteService中错误过滤home路由的问题
- 后端现在正确返回所有用户有权限的路由
- 添加设备管理相关功能(列表、在线监控、电源管理、远程监控)
- 添加详细的修复文档和重启脚本
- 更新权限配置脚本

问题根源:后端代码中有逻辑会过滤掉home路由,导致前端收到空数组,无法生成菜单
解决方案:移除过滤home路由的逻辑,让后端返回所有有权限的路由
2026-03-01 09:50:19 +08:00

122 lines
2.8 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Management.Automation;
using System.Management.Automation.Provider;
using Intel.Management.Mei;
using Intel.Management.Wsman;
namespace Intel.Management.Module
{
public class AmtDriveInfo : DriveInfo
{
WsmanConnection _conn;
//DriveItem _root;
public AmtDriveInfo(PSDriveInfo driveInfo)
: base(driveInfo)
{
_conn = new WsmanConnection();
_conn.Address = "https://ibex7m.intelmas.net:16993/wsman";
_conn.Password = "P@ssw0rd";
_conn.Username = "admin";
List<DriveItem> driveList = new List<DriveItem>();
//define the admin container
DriveItem[] adminChildren = { new StorageAdminItem(this) };
DriveContainer configContainer = new DriveContainer("Config", adminChildren);
driveList.Add(configContainer);
driveList.Add(new StorageItem(this));
if (string.Compare(driveInfo.Root,"Admin", true) == 0)
{
}
else if (string.Compare(driveInfo.Root, "Storage", true) == 0)
{
}
else
{
}
_root = new DriveContainer(string.Empty, driveList.ToArray());
//if (Root=
//"https://serverhame:16992/wsman"
}
/* public DriveItem GetItemFromPath(string path)
{
char[] pathChar = { '\\','/' };
string[] paths = path.Split(pathChar,StringSplitOptions.RemoveEmptyEntries);
//find item in path
DriveItem parent = _root;
DriveItem foundItem = null;
if (string.Compare(path, _root.Name, true) == 0)
{
foundItem = _root;
}
for (int i = 0; i < paths.Length; i++)
{
foundItem = null;
// get the parent item before accessing the children
foreach (DriveItem childItem in parent.GetChildItems(this))
{
if (string.Compare(childItem.Name, paths[i], true) == 0)
{
foundItem =childItem;
parent = foundItem;
break;
}
}
if (foundItem == null)//path not correct
{
break;
}
}
return foundItem;
}*/
public WsmanConnection WsmanConnection
{
get
{
return _conn;
}
}
}
}