41 lines
665 B
C++
41 lines
665 B
C++
#include <cgicc/Cgicc.h>
|
|
#include <cgicc/CgiDefs.h>
|
|
#include <cgicc/HTTPHTMLHeader.h>
|
|
#include <cgicc/HTMLClasses.h>
|
|
|
|
#include "handleHeader.h"
|
|
|
|
// 你的CGI处理函数声明
|
|
void handleLoginRequest(cgicc::Cgicc& cgi);
|
|
void handleSignupRequest(cgicc::Cgicc& cgi);
|
|
|
|
// 添加更多处理函数...
|
|
|
|
|
|
int main()
|
|
{
|
|
using namespace cgicc;
|
|
using namespace std;
|
|
|
|
Cgicc formData;
|
|
|
|
//获得api方法
|
|
form_iterator fi = formData.getElement("do");
|
|
|
|
if (!fi->isEmpty() && fi != (*formData).end())
|
|
{
|
|
//std::cout << "api:" << **fi << std::endl;
|
|
|
|
if (**fi == "login")
|
|
{
|
|
handleLoginRequest(formData);
|
|
}
|
|
|
|
if (**fi == "getDevices")
|
|
{
|
|
|
|
}
|
|
}
|
|
|
|
return 0;
|
|
} |