为了能快速了解并处理您的问题,请提供以下基础信息:
9.1.0
CenterOS
我通过API去访问,一直返回404
(1)我用一键迁移,下面的key和面板是可以成功的
(2)我也在一键迁移的那台服务器上运行,并且加入了白名单
std::string BT_KEY = "GzMzNAjb8tXdVBXTKCWlNWCy5Nq9nNb3"; // 接口密钥
std::string BT_PANEL = "http://38.55.184.194:24734"; // 面板地址
public:
// 构造函数:支持传入自定义面板地址和密钥
BtApi(const std::string& bt_panel = "", const std::string& bt_key = "") {
if (!bt_panel.empty()) BT_PANEL = bt_panel;
if (!bt_key.empty()) BT_KEY = bt_key;
}
// 获取面板日志
json GetLogs() {
//std::string url = BT_PANEL + "/data?action=getData";
//json p_data = GetKeyData();
//p_data["table"] = "logs";
//p_data["limit"] = 10;
//p_data["tojs"] = "test";
std::string url = BT_PANEL + "/site?action=get_site_types";
json p_data = GetKeyData();
std::cout << "url: " << url << std::endl;
std::cout << "p_data: " << p_data.dump() << std::endl;
std::string result = HttpPostCookie(url, p_data.dump());
请求返回的是404,完全不知道啥毛病
Response: <html>
<head><title>404 Not Found</title></head>
<body>
<center><h1>404 Not Found</h1></center>
<hr><center>nginx</center>
</body>
</html>
|