This commit is contained in:
parent
6c5b2d92ac
commit
7b0f0bba41
@ -159,8 +159,10 @@ Application::Application(const std::string &path)
|
|||||||
url = root["url"].as_string();
|
url = root["url"].as_string();
|
||||||
}
|
}
|
||||||
auto database = Database::session();
|
auto database = Database::session();
|
||||||
// if (std::filesystem::exists("amass_blog" + url) && url.find("/我的博客/page") != 0) {
|
if (std::filesystem::exists("amass_blog" + url) && url.find("/我的博客/page") != 0) {
|
||||||
{
|
if (url.size() > 1 && url.back() == '/') {
|
||||||
|
url.pop_back();
|
||||||
|
}
|
||||||
Wt::Dbo::Transaction transaction(*database);
|
Wt::Dbo::Transaction transaction(*database);
|
||||||
auto record = std::make_unique<VisitorRecord>();
|
auto record = std::make_unique<VisitorRecord>();
|
||||||
record->time = std::chrono::system_clock::now();
|
record->time = std::chrono::system_clock::now();
|
||||||
|
@ -2,7 +2,8 @@ find_package(Wt REQUIRED Wt)
|
|||||||
|
|
||||||
add_library(WebApplication
|
add_library(WebApplication
|
||||||
WebApplication.h WebApplication.cpp
|
WebApplication.h WebApplication.cpp
|
||||||
LoginWidget.h LoginWidget.cpp
|
LoginPage.h LoginPage.cpp
|
||||||
|
VisitorRecordsPage.h VisitorRecordsPage.cpp
|
||||||
Hello.h Hello.cpp
|
Hello.h Hello.cpp
|
||||||
Restful.h Restful.cpp
|
Restful.h Restful.cpp
|
||||||
Dialog.h Dialog.cpp
|
Dialog.h Dialog.cpp
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#include "BoostLog.h"
|
#include "BoostLog.h"
|
||||||
#include "Database/Session.h"
|
#include "Database/Session.h"
|
||||||
#include "Dialog.h"
|
#include "Dialog.h"
|
||||||
#include "LoginWidget.h"
|
#include "LoginPage.h"
|
||||||
#include "WebApplication.h"
|
#include "WebApplication.h"
|
||||||
#include <Wt/Auth/Identity.h>
|
#include <Wt/Auth/Identity.h>
|
||||||
#include <Wt/WBootstrap2Theme.h>
|
#include <Wt/WBootstrap2Theme.h>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "LoginWidget.h"
|
#include "LoginPage.h"
|
||||||
#include "WebApplication.h"
|
#include "WebApplication.h"
|
||||||
#include <Wt/Auth/AuthService.h>
|
#include <Wt/Auth/AuthService.h>
|
||||||
#include <Wt/Auth/AuthWidget.h>
|
#include <Wt/Auth/AuthWidget.h>
|
||||||
@ -12,6 +12,8 @@ LoginWidget::LoginWidget(Wt::Auth::AbstractUserDatabase &users, Wt::Auth::Login
|
|||||||
authWidget->model()->addPasswordAuth(&app->passwordService());
|
authWidget->model()->addPasswordAuth(&app->passwordService());
|
||||||
authWidget->setRegistrationEnabled(true);
|
authWidget->setRegistrationEnabled(true);
|
||||||
authWidget->processEnvironment();
|
authWidget->processEnvironment();
|
||||||
setAttributeValue("style", "transform: translateY(-100px);");
|
// setAttributeValue("style", "transform: translateY(-100px);");
|
||||||
addWidget(std::move(authWidget));
|
addWidget(std::move(authWidget));
|
||||||
|
|
||||||
|
authWidget-> resolve<WInteractWidget *>("login")->addStyleClass("button--primary");
|
||||||
}
|
}
|
1
WebApplication/VisitorRecordsPage.cpp
Normal file
1
WebApplication/VisitorRecordsPage.cpp
Normal file
@ -0,0 +1 @@
|
|||||||
|
#include "VisitorRecordsPage.h"
|
9
WebApplication/VisitorRecordsPage.h
Normal file
9
WebApplication/VisitorRecordsPage.h
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#ifndef __VISITORRECORDSPAGE_H__
|
||||||
|
#define __VISITORRECORDSPAGE_H__
|
||||||
|
|
||||||
|
class VisitorRecordsPage {
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif // __VISITORRECORDSPAGE_H__
|
Loading…
Reference in New Issue
Block a user