- 修复RouteService中错误过滤home路由的问题 - 后端现在正确返回所有用户有权限的路由 - 添加设备管理相关功能(列表、在线监控、电源管理、远程监控) - 添加详细的修复文档和重启脚本 - 更新权限配置脚本 问题根源:后端代码中有逻辑会过滤掉home路由,导致前端收到空数组,无法生成菜单 解决方案:移除过滤home路由的逻辑,让后端返回所有有权限的路由
87 lines
2.3 KiB
C++
87 lines
2.3 KiB
C++
//----------------------------------------------------------------------------
|
|
//
|
|
// Copyright (C) Intel Corporation, 2006 - 2007.
|
|
//
|
|
// File: SOAPCommunicator.cpp
|
|
//
|
|
// Contents: Allows communication of Soap messages.
|
|
//
|
|
// Notes:
|
|
//----------------------------------------------------------------------------
|
|
|
|
#include "SOAPCommunicator.h"
|
|
#include "SoapCommonDefinitions.h"
|
|
#ifdef _WIN32
|
|
SOAPCommunicator::SOAPCommunicator(const char* host, bool tls, const char* user,
|
|
const char* pass, const char* certName, bool kerberos)
|
|
#else
|
|
SOAPCommunicator::SOAPCommunicator(const char* host, bool tls, const char* user,
|
|
const char* pass, const char* certPass, const char* certName,
|
|
bool kerberos)
|
|
#endif
|
|
{
|
|
is_tls = tls;
|
|
setURLFromIP(host);
|
|
#ifdef _WIN32
|
|
soap = new Soap(enTarget.c_str(), (const CHAR*)certName, user, pass, false, kerberos);
|
|
#else
|
|
soap = new Soap(enTarget.c_str(), (const CHAR*)certName, NULL, user, pass);
|
|
#endif
|
|
}
|
|
|
|
SOAPCommunicator::~SOAPCommunicator()
|
|
{
|
|
if(soap)
|
|
{
|
|
delete soap;
|
|
}
|
|
}
|
|
|
|
// Set the Managment-Console IP for the next notification
|
|
void SOAPCommunicator::SetTarget(const char *url)
|
|
{
|
|
if (soap)
|
|
{
|
|
setURLFromIP(url);
|
|
soap->SetIp(enTarget.c_str());
|
|
}
|
|
}
|
|
int SOAPCommunicator::SendEvent(string MEAddress ,
|
|
unsigned short MEPort,
|
|
string ME_UUID,
|
|
string MPSAddress,
|
|
unsigned short MPSHttpPort,
|
|
unsigned short MPSSocksPort,
|
|
mps__ConnectionStateTypeDefinition state)
|
|
{
|
|
int status = 0;
|
|
mps__EventNotificationType eventNotification;
|
|
eventNotification.DeviceFqdn = MEAddress;
|
|
eventNotification.State = state;
|
|
eventNotification.DevicePort.push_back(MEPort);
|
|
eventNotification.DeviceUuid = ME_UUID;
|
|
eventNotification.MpsAddress = MPSAddress;
|
|
eventNotification.MpsHttpPort = MPSHttpPort;
|
|
eventNotification.MpsSocksPort = MPSSocksPort;
|
|
eventNotification.WantReply = false;
|
|
soap->Init();
|
|
_mps__EventNotificationRequest request;
|
|
_mps__MPSAlertResponse response;
|
|
request.MPSEvent = &eventNotification;
|
|
if(soap_call___mps__MPSAlert(soap->GetSoap(),soap->GetIp(),
|
|
NULL,&request,response))
|
|
{
|
|
status = -1;
|
|
}
|
|
else
|
|
{
|
|
status = (int)response.KeepConnection;
|
|
}
|
|
return status;
|
|
|
|
}
|
|
void SOAPCommunicator::setURLFromIP(string ip)
|
|
{
|
|
enTarget = ip;
|
|
}
|