readd url filter.
All checks were successful
Deploy / Build (push) Successful in 4m57s

This commit is contained in:
amass 2024-11-27 23:50:04 +08:00
parent 6c5b2d92ac
commit 7b0f0bba41
7 changed files with 21 additions and 6 deletions

View File

@ -159,8 +159,10 @@ Application::Application(const std::string &path)
url = root["url"].as_string();
}
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);
auto record = std::make_unique<VisitorRecord>();
record->time = std::chrono::system_clock::now();

View File

@ -2,7 +2,8 @@ find_package(Wt REQUIRED Wt)
add_library(WebApplication
WebApplication.h WebApplication.cpp
LoginWidget.h LoginWidget.cpp
LoginPage.h LoginPage.cpp
VisitorRecordsPage.h VisitorRecordsPage.cpp
Hello.h Hello.cpp
Restful.h Restful.cpp
Dialog.h Dialog.cpp

View File

@ -2,7 +2,7 @@
#include "BoostLog.h"
#include "Database/Session.h"
#include "Dialog.h"
#include "LoginWidget.h"
#include "LoginPage.h"
#include "WebApplication.h"
#include <Wt/Auth/Identity.h>
#include <Wt/WBootstrap2Theme.h>

View File

@ -1,4 +1,4 @@
#include "LoginWidget.h"
#include "LoginPage.h"
#include "WebApplication.h"
#include <Wt/Auth/AuthService.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->setRegistrationEnabled(true);
authWidget->processEnvironment();
setAttributeValue("style", "transform: translateY(-100px);");
// setAttributeValue("style", "transform: translateY(-100px);");
addWidget(std::move(authWidget));
authWidget-> resolve<WInteractWidget *>("login")->addStyleClass("button--primary");
}

View File

@ -0,0 +1 @@
#include "VisitorRecordsPage.h"

View File

@ -0,0 +1,9 @@
#ifndef __VISITORRECORDSPAGE_H__
#define __VISITORRECORDSPAGE_H__
class VisitorRecordsPage {
};
#endif // __VISITORRECORDSPAGE_H__