添加新的响应
This commit is contained in:
parent
cbc4a018c0
commit
214c87c6b4
@ -14,9 +14,9 @@ void res_not_exist(mg_connection* conn);
|
|||||||
void res_permission_denied(mg_connection* conn);
|
void res_permission_denied(mg_connection* conn);
|
||||||
void res_need_user_id(mg_connection* conn);
|
void res_need_user_id(mg_connection* conn);
|
||||||
void res_need_password(mg_connection* conn);
|
void res_need_password(mg_connection* conn);
|
||||||
void res_(mg_connection* conn);
|
void res_need_action(mg_connection* conn);
|
||||||
void res_(mg_connection* conn);
|
void res_bad_action(mg_connection* conn);
|
||||||
void res_(mg_connection* conn);
|
void res_need_xxx(mg_connection* conn,const char* xxx);
|
||||||
void res_(mg_connection* conn);
|
void res_(mg_connection* conn);
|
||||||
|
|
||||||
|
|
||||||
|
@ -225,3 +225,30 @@ void res_repermission(mg_connection* conn)
|
|||||||
"Access-Control-Allow-Origin: *\r\n\r\n"
|
"Access-Control-Allow-Origin: *\r\n\r\n"
|
||||||
"{\"success\":\"repermission success\"}");
|
"{\"success\":\"repermission success\"}");
|
||||||
}
|
}
|
||||||
|
void res_need_action(mg_connection* conn)
|
||||||
|
{
|
||||||
|
mg_printf(conn,
|
||||||
|
"HTTP/1.1 400 Bad Request\r\n"
|
||||||
|
"Content-Type: application/json\r\n"
|
||||||
|
"Access-Control-Allow-Origin: *\r\n\r\n"
|
||||||
|
"{\"error\":\"need action specification\"}");
|
||||||
|
}
|
||||||
|
|
||||||
|
void res_bad_action(mg_connection* conn)
|
||||||
|
{
|
||||||
|
mg_printf(conn,
|
||||||
|
"HTTP/1.1 400 Bad Request\r\n"
|
||||||
|
"Content-Type: application/json\r\n"
|
||||||
|
"Access-Control-Allow-Origin: *\r\n\r\n"
|
||||||
|
"{\"error\":\"bad action\"}");
|
||||||
|
}
|
||||||
|
|
||||||
|
void res_need_xxx(mg_connection* conn, const char* xxx)
|
||||||
|
{
|
||||||
|
mg_printf(conn,
|
||||||
|
"HTTP/1.1 400 Bad Request\r\n"
|
||||||
|
"Content-Type: application/json\r\n"
|
||||||
|
"Access-Control-Allow-Origin: *\r\n\r\n"
|
||||||
|
"{\"error\":\"need %s\"}",
|
||||||
|
xxx);
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user