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

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

134 lines
3.2 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;
using System.Management.Automation;
namespace Intel.Management.Module
{
/// <summary>
/// Base definition of an AmtDriveItem
/// </summary>
public class AmtDriveItem
{
protected string _name;
protected object _value;
// defines an Empty Container
protected static readonly AmtDriveItem[] _emptyContainer = new AmtDriveItem[0];
protected static readonly string[] _emptyProperties = new string[0];
public AmtDriveItem(String name)
{
_name = name;
_value = string.Empty;
}
public AmtDriveItem(String name,object value)
{
_name = name;
_value = value;
}
public virtual void SetItem(AmtDriveInfo driveInfo,object values, bool force)
{
}
public virtual object GetProperty(AmtDriveInfo info, Collection<string> propList)
{
return null;
}
public virtual void SetProperty(AmtDriveInfo info, PSObject propertyValue, bool force)
{
}
public virtual void Invoke(AmtDriveInfo driveInfo)
{
}
public virtual object InvokeDefaultActionDynamicParameters(AmtDriveInfo driveInfo)
{
return null;
}
public virtual AmtDriveItem NewItem(AmtDriveInfo driveInfo, string name, string type, object newItem)
{
throw new InvalidOperationException();
}
public virtual void RemoveItem(AmtDriveInfo driveInfo, bool force)
{
throw new InvalidOperationException();
}
public virtual string Name
{
get { return _name; }
}
public virtual object Value
{
get { return _value; }
}
public virtual string[] Properties
{
get { return _emptyProperties; }
}
public virtual AmtDriveItem[] GetChildItems(AmtDriveInfo driveInfo)
{
return _emptyContainer;
}
public virtual void ClearItemCache()
{
}
protected object GetProperties(IDictionary<string, object> props, Collection<string> propList)
{
object result = null;
if (propList.Count == 0)
{
result = new PSObject();
//write all the properties
foreach (KeyValuePair<string, object> pair in props)
{
((PSObject)result).Properties.Add(
new PSNoteProperty(pair.Key, pair.Value));
}
}
else if (propList.Count == 1)
{
result = props[propList[0]];
}
else
{
result = new PSObject();
foreach (string propName in propList)
{
((PSObject)result).Properties.Add(
new PSNoteProperty(propName, props[propName]));
}
}
return result;
}
}
}