From a1754b7f4c877ab7f1f980b0e32c3424258c1197 Mon Sep 17 00:00:00 2001 From: yyb <1416014977@qq.com> Date: Wed, 14 Jan 2026 15:53:21 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E9=82=AE=E7=AE=B1=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E7=A0=81=E6=A8=A1=E7=89=88=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/LeaseUserServiceImpl.java | 117 +++++-------- .../resources/templates/emailoffline-en.html | 37 ---- .../templates/power_leasingEmail.html | 161 ++++++++++++++++++ 3 files changed, 203 insertions(+), 112 deletions(-) delete mode 100644 src/main/resources/templates/emailoffline-en.html create mode 100644 src/main/resources/templates/power_leasingEmail.html diff --git a/src/main/java/com/m2pool/lease/service/impl/LeaseUserServiceImpl.java b/src/main/java/com/m2pool/lease/service/impl/LeaseUserServiceImpl.java index 05f3ed5..ea29576 100644 --- a/src/main/java/com/m2pool/lease/service/impl/LeaseUserServiceImpl.java +++ b/src/main/java/com/m2pool/lease/service/impl/LeaseUserServiceImpl.java @@ -1,7 +1,6 @@ package com.m2pool.lease.service.impl; -import cn.hutool.json.JSONUtil; import com.alibaba.fastjson.JSON; import com.alibaba.nacos.common.utils.StringUtils; import com.baomidou.dynamic.datasource.annotation.DSTransactional; @@ -638,12 +637,10 @@ public class LeaseUserServiceImpl extends ServiceImpl content = new HashMap<>(); content.put("code",code); content.put("text","Login verification code is valid within 10 minutes"); - EmailTemplateEntity entity = new EmailTemplateEntity(to,"User login, email verification code","emailCode-en",content); + EmailTemplateEntity entity = new EmailTemplateEntity(to,"User login, email verification code","power_leasingEmail",content); sendHtmlEmail(entity.getEmail(),entity.getSubject(),entity.getTemplateName(),entity.getData()); } @@ -653,35 +650,37 @@ public class LeaseUserServiceImpl extends ServiceImpl content = new HashMap<>(); content.put("code",code); content.put("text","The verification code for registration is valid for 10 minutes"); - EmailTemplateEntity message = new EmailTemplateEntity(to,"Account registration, email verification code","emailCode-en",content); + EmailTemplateEntity message = new EmailTemplateEntity(to,"Account registration, email verification code","power_leasingEmail",content); sendHtmlEmail(message.getEmail(),message.getSubject(),message.getTemplateName(),message.getData()); } + /** + * 发送修改密码的邮件 + * @param to + * @param code + */ public void sendUpdatePwdMailMessage(String to, String code) { - //String subject = "修改密码,邮箱验证码"; - //String text = "您正在修改密码,如果不是您本人操作,请忽略。验证码10分钟内有效:\n\t"+code; - Map content = new HashMap<>(); content.put("code",code); content.put("text","You are currently modifying your password. If this is not done by you, please ignore it. The verification code is valid for 10 minutes."); - EmailTemplateEntity entity = new EmailTemplateEntity(to,"Change password, email verification code","emailCode-en",content); + EmailTemplateEntity entity = new EmailTemplateEntity(to,"Change password, email verification code","power_leasingEmail",content); sendHtmlEmail(entity.getEmail(),entity.getSubject(),entity.getTemplateName(),entity.getData()); } + /** + * 发送注销账户邮件 + * @param to + * @param code + */ public void sendCloseAccountMailMessage(String to, String code) { - //String subject = "修改密码,邮箱验证码"; - //String text = "您正在修改密码,如果不是您本人操作,请忽略。验证码10分钟内有效:\n\t"+code; - Map content = new HashMap<>(); content.put("code",code); content.put("text","You are logging out of the user account. If this is not done by you, please ignore it. The verification code is valid for 10 minutes."); - EmailTemplateEntity entity = new EmailTemplateEntity(to,"Change password, email verification code","emailCode-en",content); + EmailTemplateEntity entity = new EmailTemplateEntity(to,"Change password, email verification code","power_leasingEmail",content); sendHtmlEmail(entity.getEmail(),entity.getSubject(),entity.getTemplateName(),entity.getData()); } /** @@ -839,8 +838,6 @@ public class LeaseUserServiceImpl extends ServiceImpl content = new HashMap<>(); + content.put("code",code); + content.put("text","The validity period for binding Google two-factor authentication email verification code is 10 minutes"); + EmailTemplateEntity message = new EmailTemplateEntity(to,"Bind Google two-factor authentication, email verification code","power_leasingEmail",content); + sendHtmlEmail(message.getEmail(),message.getSubject(),message.getTemplateName(),message.getData()); - //发送邮件 - javaMailSender.send(mimeMessageHelper.getMimeMessage()); - //System.out.println("发送邮件成功:"+sendMailer+"->"+to); - return true; - } catch (Exception e) { - System.out.println("发送邮件失败:"+e.getMessage()); - return false; - } } @Override @@ -912,7 +895,6 @@ public class LeaseUserServiceImpl extends ServiceImpl content = new HashMap<>(); + content.put("code",code); + content.put("text","Turning off Google's two-factor authentication email verification code is valid for 10 minutes"); + EmailTemplateEntity message = new EmailTemplateEntity(to,"Turning off Google two-factor authentication, email verification code","power_leasingEmail",content); + sendHtmlEmail(message.getEmail(),message.getSubject(),message.getTemplateName(),message.getData()); - //发送邮件 - javaMailSender.send(mimeMessageHelper.getMimeMessage()); - //System.out.println("发送邮件成功:"+sendMailer+"->"+to); - return true; - } catch (Exception e) { - System.out.println("发送邮件失败:"+e.getMessage()); - return false; - } } @Override public Result closeStepTwo(GoogleCloseVo vo) { diff --git a/src/main/resources/templates/emailoffline-en.html b/src/main/resources/templates/emailoffline-en.html deleted file mode 100644 index b99f740..0000000 --- a/src/main/resources/templates/emailoffline-en.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - offline notification - - -
- -
- logo -
- - -
-

Your mining account:  

-

mining machines are offline!

-

If your mining rig has been abnormally disconnected, please address it promptly!

-
- - - -
- - - - diff --git a/src/main/resources/templates/power_leasingEmail.html b/src/main/resources/templates/power_leasingEmail.html new file mode 100644 index 0000000..1334dbc --- /dev/null +++ b/src/main/resources/templates/power_leasingEmail.html @@ -0,0 +1,161 @@ + + + + + + + Power Leasing - 邮箱验证码 + + + +
+
+

+

+ +
+ + +
+ +

+ 如果这不是你的操作,请忽略本邮件。 +

+
+ + +
+ +