HwangKC 2024-06-11 15:48:05 +08:00
parent 551db17c1e
commit 3578934ed4
4 changed files with 18 additions and 9 deletions

View File

@ -3,7 +3,7 @@
#include <cgicc/HTTPHTMLHeader.h>
// 注册请求处理函数
void handleSignupRequest(cgicc::Cgicc& cgi)
void handleDevicesRequest(cgicc::Cgicc& cgi)
{
#if 0 // 获取表单数据
std::string username = cgi.getEnvironment().get("username");

View File

@ -7,6 +7,7 @@
#include <cgicc/HTMLClasses.h>
#include "handleHeader.h"
#include "openjson.h"
#include "opmysql.h"

View File

@ -0,0 +1,11 @@
#ifndef __HANDLER_DEFINE_INCLUDE__
#define __HANDLER_DEFINE_INCLUDE__
#include <cgicc/CgiDefs.h>
#include <cgicc/Cgicc.h>
// 你的CGI处理函数声明
void handleLoginRequest(cgicc::Cgicc& cgi);
void handleDevicesRequest(cgicc::Cgicc& cgi);
#endif //__HANDLER_DEFINE_INCLUDE__

View File

@ -3,15 +3,12 @@
#include <cgicc/HTTPHTMLHeader.h>
#include <cgicc/HTMLClasses.h>
#include <hv/hv.h>
#include "handleHeader.h"
#include "openjson.h"
#include "opmysql.h"
// 你的CGI处理函数声明
void handleLoginRequest(cgicc::Cgicc& cgi);
void handleSignupRequest(cgicc::Cgicc& cgi);
#include "handleHeader.h"
#include "handlers.h"
// 添加更多处理函数...
@ -112,9 +109,9 @@ int main()
handleLoginRequest(formData);
}
if (**fi == "getDevices")
if (**fi == "devices")
{
handleDevicesRequest(formData);
}
}