From 3392f8a0b30087a78fe6dcba1034ae9e239957d5 Mon Sep 17 00:00:00 2001 From: luocai Date: Thu, 14 Nov 2024 21:53:18 +0800 Subject: [PATCH] add auth api. --- WebApplication/Restful.cpp | 2 +- WebApplication/Restful.h | 2 +- WebApplication/WebApplication.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/WebApplication/Restful.cpp b/WebApplication/Restful.cpp index b7a3c29..1ba460a 100644 --- a/WebApplication/Restful.cpp +++ b/WebApplication/Restful.cpp @@ -8,7 +8,7 @@ DBO_INSTANTIATE_TEMPLATES(MyMessage) DbStruct *m_dbStruct; -void JsonResource::handleRequest(const Wt::Http::Request &request, Wt::Http::Response &response) { +void AuthenticationResource::handleRequest(const Wt::Http::Request &request, Wt::Http::Response &response) { response.setMimeType("application/json"); response.addHeader("Server", "Wt"); diff --git a/WebApplication/Restful.h b/WebApplication/Restful.h index d966c68..ec9b368 100644 --- a/WebApplication/Restful.h +++ b/WebApplication/Restful.h @@ -44,7 +44,7 @@ struct DbStruct { std::uniform_int_distribution distribution; }; -class JsonResource : public Wt::WResource { +class AuthenticationResource : public Wt::WResource { public: void handleRequest(const Wt::Http::Request &request, Wt::Http::Response &response) final; }; diff --git a/WebApplication/WebApplication.cpp b/WebApplication/WebApplication.cpp index f8f8471..360200f 100644 --- a/WebApplication/WebApplication.cpp +++ b/WebApplication/WebApplication.cpp @@ -30,7 +30,7 @@ WebApplication::WebApplication() { m_server = std::make_unique("./build", args); m_server->addEntryPoint(Wt::EntryPointType::Application, createApplication, "/hello"); m_server->addEntryPoint(Wt::EntryPointType::WidgetSet, createWidgetSet, "/gui/hello.js"); - m_server->addResource(std::make_shared(), "/json"); + m_server->addResource(std::make_shared(), "/auth"); m_server->addResource(std::make_shared(), "/plaintext"); m_server->addResource(std::make_shared("database.sqlite"), "/db");