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

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

56 lines
1.3 KiB
C++
Raw Blame History

//----------------------------------------------------------------------------
//
// Copyright (C) 2004 Intel Corporation
//
// File: SoapUtils.cpp
//
// Contents: Sample code for an Intel<65> AMT Network client.
//
// Notes: This file contains the function implementations
// used throughout the code of the all SOAP sample applications.
//
//----------------------------------------------------------------------------
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "SoapCommonDefinitions.h"
/*
* Changes the service name at the URI
* Arguments:
* uri - null-terminated string which holds the whole URI as supplied
* at the command line
* newService - string which represents the new service name
* newUri - pre-allocated string which will hold the new service URI
*/
bool ChangeService(const char *uri, const char *newService, char *newUri)
{
if (NULL == newUri)
{
return false;
}
const char *tmp = strrchr(uri,'/');
if(tmp == NULL)
{
return false;
}
int n = tmp - uri + 1;
if (strncpy_s(newUri, 2048, uri, n)) {
return false;
}
newUri[strnlen_s(uri, 2048) - strnlen_s(tmp, 2048) + 1] = '\0';
//copy newService to end of string instead '\0'
if (strcpy_s(&(newUri[n]), 2048, newService)) {
return false;
}
return true;
}