From 2019bce30e8de0a67aa7eab5134bdbc3dc3d4b70 Mon Sep 17 00:00:00 2001
From: eson <9673575+githubcontent@user.noreply.gitee.com>
Date: Tue, 5 Sep 2023 15:38:53 +0800
Subject: [PATCH] fix

---
 .../{reset_password.tpl => get_reset_password_html.tpl}  | 4 +---
 server/auth/internal/logic/userresettokenlogic.go        | 9 ++++-----
 2 files changed, 5 insertions(+), 8 deletions(-)
 rename fs_template/{reset_password.tpl => get_reset_password_html.tpl} (70%)

diff --git a/fs_template/reset_password.tpl b/fs_template/get_reset_password_html.tpl
similarity index 70%
rename from fs_template/reset_password.tpl
rename to fs_template/get_reset_password_html.tpl
index 828226c6..f5063ed4 100644
--- a/fs_template/reset_password.tpl
+++ b/fs_template/get_reset_password_html.tpl
@@ -1,11 +1,9 @@
 Dear {{ .UserName }},
 
-We have received your request to reset your {{ .CompanyName }} account password.
+We have received your request to reset the password for your {{ .CompanyName }} account.
 
 Please click the button below to confirm your new password:
 
-<h1 style="color: red; font-weight: bold;">{{ .MaskedPassword }}</h1> (This can be replaced by the masked new password)
-
 <a href="{{ .ConfirmationLink }}" target="_blank" style="background-color: #008CBA; color: #FFFFFF; text-decoration: none; padding: 10px 15px; border-radius: 3px; font-weight: bold;">Confirm New Password</a>
 
 This password reset confirmation link will expire in 60 minutes. Please let us know if you have any other questions!
diff --git a/server/auth/internal/logic/userresettokenlogic.go b/server/auth/internal/logic/userresettokenlogic.go
index b13eaa49..b7150b9a 100644
--- a/server/auth/internal/logic/userresettokenlogic.go
+++ b/server/auth/internal/logic/userresettokenlogic.go
@@ -62,16 +62,15 @@ func (l *UserResetTokenLogic) UserResetToken(req *types.RequestUserResetToken, u
 	userName := *user.FirstName + " " + *user.LastName
 	// 进入发送邮箱的系统
 	EmailManager.EmailTasks <- &EmailFormat{
-		TemplateName:     "reset_password.tpl",
+		TemplateName:     "get_reset_password_html.tpl",
 		UniqueKey:        "reset_password-" + req.Email,
 		TargetEmail:      req.Email,
 		CompanyName:      "fusen",
-		ConfirmationLink: resetToken, // 跳转连接
+		ConfirmationLink: l.svcCtx.Config.MainAddress + "/api/auth/reset/password/html?reset_token=" + resetToken, // 跳转连接
 		SenderName:       "support@fusenpack.com",
-		SenderTitle:      "register-valid",
+		SenderTitle:      "reset password",
 		Extend: map[string]string{
-			"UserName":   userName,
-			"ResetToken": resetToken,
+			"UserName": userName,
 		},
 	} // email进入队