From af1f26b322cd19220facce08c7412048a04193bd Mon Sep 17 00:00:00 2001 From: eson <9673575+githubcontent@user.noreply.gitee.com> Date: Mon, 4 Sep 2023 18:43:31 +0800 Subject: [PATCH] fix --- fs_template/reset_confirm.tpl | 129 ++++++++++++++++++ .../logic/useremailconfirmationlogic.go | 2 +- 2 files changed, 130 insertions(+), 1 deletion(-) create mode 100644 fs_template/reset_confirm.tpl diff --git a/fs_template/reset_confirm.tpl b/fs_template/reset_confirm.tpl new file mode 100644 index 00000000..72dfba60 --- /dev/null +++ b/fs_template/reset_confirm.tpl @@ -0,0 +1,129 @@ +<!DOCTYPE html> +<html> +<head> +<meta name="viewport" content="width=device-width, initial-scale=1"> +<style> + +body { + font-family: Arial, sans-serif; + background-color: #f5f5f5; +} + +.container { + margin: 0 auto; + max-width: 400px; + margin: 50px auto; + background-color: #fff; + padding: 20px; + border-radius: 5px; + box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3); +} + +h2 { + text-align: center; + margin-bottom: 20px; +} + +.form-group { + margin-bottom: 15px; + display: flex; +} + +input[type="password"] { + flex: 1; +} + +label { + display: block; + margin-bottom: 5px; + width: 9rem; +} + +input[type="password"] { + padding: 1rem; + border: 1px solid #ccc; + border-radius: 3px; +} + +button { + width: 100%; + padding: 10px; + background-color: #007bff; + color: #fff; + border: none; + border-radius: 3px; + cursor: pointer; +} + +button:hover { + background-color: #0056b3; +} + + +/* Mobile */ +@media screen and (max-width: 767px) { + .container { + padding: 10px; + } + + h2 { + font-size: 1.5rem; + } + + .form-group { + flex-direction: column; + box-sizing: border-box; + } + + label { + margin-bottom: 10px; + } +} + +/* Tablet */ +@media screen and (min-width: 768px) and (max-width: 1023px) { + .container { + padding: 30px; + } + + .form-group { + flex-direction: row; + } +} + +/* Desktop */ +@media screen and (min-width: 1024px) { + .container { + max-width: 600px; + } +} + +</style> +</head> + +<body> + +<div class="container"> + +<h2>Reset Password</h2> + +<form> + + <div class="form-group"> + <label for="newPassword">New Password</label> + <input id="newPassword" type="password" placeholder="New password" required pattern="^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}$"> + </div> + + <div class="form-group"> + <label for="confirmPassword">Confirm Password</label> + <input id="confirmPassword" type="password" placeholder="Confirm password" required pattern="^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}$"> + </div> + + <button type="submit">Reset Password</button> + +</form> + +</div> + +</body> +</html> \ No newline at end of file diff --git a/server/auth/internal/logic/useremailconfirmationlogic.go b/server/auth/internal/logic/useremailconfirmationlogic.go index 6ae4fac6..397d04ea 100644 --- a/server/auth/internal/logic/useremailconfirmationlogic.go +++ b/server/auth/internal/logic/useremailconfirmationlogic.go @@ -45,7 +45,7 @@ func FinishRegister(svcCtx *svc.ServiceContext, user *gmodel.FsUser, token *auth svcCtx.Config.Auth.AccessExpire, time.Now().UTC().Unix(), user.Id, - token.GuestId, + 0, ) if err != nil {