From fed59acef32fd70bc2bf75c4a6171988617f50ff Mon Sep 17 00:00:00 2001 From: amass Date: Wed, 25 Dec 2024 22:07:00 +0800 Subject: [PATCH] improve email verify. --- UnitTest/MailTest.cpp | 8 +++--- WebApplication/Application.cpp | 2 +- WebApplication/BulmaTheme.cpp | 4 +-- resources/auth_css_theme.xml | 25 ++++++++++++++++- resources/auth_strings_zh.xml | 51 ++++++++++------------------------ 5 files changed, 46 insertions(+), 44 deletions(-) diff --git a/UnitTest/MailTest.cpp b/UnitTest/MailTest.cpp index 8e2d1f6..2ef75e4 100644 --- a/UnitTest/MailTest.cpp +++ b/UnitTest/MailTest.cpp @@ -6,13 +6,13 @@ // BOOST_AUTO_TEST_CASE(MailTest) { // Wt::Mail::Client client; -// client.enableAuthentication("17688947728@163.com", "yourpassword", Wt::Mail::AuthenticationMethod::Login); +// client.enableAuthentication("168062547@qq.com", "yourpassword", Wt::Mail::AuthenticationMethod::Login); // client.setTransportEncryption(Wt::Mail::TransportEncryption::TLS); -// LOG(info) << client.connect("smtp.163.com", 465); +// LOG(info) << client.connect("smtp.qq.com", 465); -// Wt::Mail::Mailbox from("17688947728@163.com"); +// Wt::Mail::Mailbox from("168062547@qq.com"); -// Wt::Mail::Mailbox to("168062547@qq.com"); +// Wt::Mail::Mailbox to("amass.law1996@gmail.com"); // Wt::Mail::Message message; // message.setFrom(from); diff --git a/WebApplication/Application.cpp b/WebApplication/Application.cpp index 666b48c..632a6cf 100644 --- a/WebApplication/Application.cpp +++ b/WebApplication/Application.cpp @@ -137,7 +137,7 @@ Server::Server(uint16_t port, const std::string &applicationRoot, const std::str std::bind(&Server::createApplication, this, std::placeholders::_1, false)); m_server->addEntryPoint(Wt::EntryPointType::WidgetSet, std::bind(&Server::createApplication, this, std::placeholders::_1, true), "/wt/app.js"); - m_server->addResource(std::make_shared(), "/auth"); + m_server->addResource(std::make_shared(), "/auth/verify"); m_server->addResource(std::make_shared(), "/plaintext"); m_server->start(); diff --git a/WebApplication/BulmaTheme.cpp b/WebApplication/BulmaTheme.cpp index aa6b6c3..77924db 100644 --- a/WebApplication/BulmaTheme.cpp +++ b/WebApplication/BulmaTheme.cpp @@ -26,11 +26,11 @@ void BulmaTheme::init(Wt::WApplication *app) const { } std::string BulmaTheme::disabledClass() const { - return ""; + return "bulma-is-disabled"; // bulma 没有这个类 } std::string BulmaTheme::activeClass() const { - return ""; + return "bulma-is-active"; } std::string BulmaTheme::utilityCssClass(int utilityCssClassRole) const { diff --git a/resources/auth_css_theme.xml b/resources/auth_css_theme.xml index 951aca1..1425aa7 100644 --- a/resources/auth_css_theme.xml +++ b/resources/auth_css_theme.xml @@ -38,7 +38,7 @@ ${tr:Wt.Auth.password}
- ${password class="bulma-input"} + ${password class="bulma-input" type="password"} @@ -248,4 +248,27 @@
+ + +

${tr:Wt.Auth.resend-verification-msg}

+
+ +
+ ${email class="bulma-input" type="email"} + + + +
+ ${email-info} +
+ +
+
+ ${send-button class="bulma-button bulma-is-link"} +
+
+ ${cancel-button class="bulma-button bulma-is-link bulma-is-light"} +
+
+
diff --git a/resources/auth_strings_zh.xml b/resources/auth_strings_zh.xml index f41ddaf..07b5071 100644 --- a/resources/auth_strings_zh.xml +++ b/resources/auth_strings_zh.xml @@ -90,10 +90,10 @@ {1}s后重试 重新发送? - Resend Email Verification - Please enter your email address again below to resend the verification email. Make sure to check your spam folder in case the email does not show up in your inbox. - Email address does not match this user - Email verification + 重新发送邮件验证 + 请在下方再次输入您的电子邮箱地址以重新发送验证邮件。如果收件箱中未收到邮件,请务必查看垃圾邮件文件夹。 + 电子邮箱地址与该用户不匹配 + 邮箱验证 @@ -155,59 +155,38 @@ - User account activation Link + 用户帐号激活链接 Hello {1}, -Thank you for joining! +感谢您的参与! -To complete your registration, please finally confirm your account by -clicking on the following link or copying the URL into your browser. +要完成您的注册,请最后确认您的帐户点击以下链接或将URL复制到您的浏览器中。 -Please click here to confirm your registration or copy and paste the -following URL into your browser: (Note: be sure to copy the entire -URL, including any part of it which goes onto a second line.) +请点击此处确认您的注册,或者将以下网址复制粘贴到您的浏览器中:(注意:请确保复制整个网址,包括任何延续到第二行的部分。) {3} -This text is resolved from the "Wt.Auth.confirmmail.subject", -"Wt.Auth.confirmmail.body", and "Wt.Auth.confirmmail.htmlbody" -resource keys. +再次感觉您的参与,希望这能为您带来点什么~ -Good luck with your Wt application, - -The Wt team. +amass.

Hello {1},

-

Thank you for joining!

+

感谢您的参与!

-

To complete your registration, please finally confirm your - account by clicking on the following link or copying the URL into - your browser.

+

要完成您的注册,请最后确认您的帐户点击以下链接或将URL复制到您的浏览器中。

-

Please click here to confirm your - registration or copy and paste the following URL into your - browser: (Note: be sure to copy the entire URL, including any - part of it which goes onto a second line.)

+

点击此处确认 您的注册,或者将以下网址复制粘贴到您的浏览器中: (注意:请确保复制整个网址,包括任何延续到第二行的部分。)

{3} -

- Note to developer: -

-

- This text is resolved from the "Wt.Auth.confirmmail.subject", - "Wt.Auth.confirmmail.body", and "Wt.Auth.confirmmail.htmlbody" - resource keys. -

+

再次感觉您的参与,希望这能为您带来点什么~

-

Good luck with your Wt application,

- -

The Wt team.

+

amass.

Lost password instructions