mirror of
https://github.com/snowykami/neo-blog.git
synced 2025-09-26 11:06:23 +00:00
feat: 更新验证码逻辑,优化邮件验证功能,增加验证码冷却时间,改进用户体验Closes #17
This commit is contained in:
@ -114,7 +114,13 @@ func (s *UserService) UserRegister(req *dto.UserRegisterReq) (*dto.UserRegisterR
|
||||
|
||||
func (s *UserService) RequestVerifyEmail(req *dto.VerifyEmailReq) (*dto.VerifyEmailResp, error) {
|
||||
verifyCode := utils.RequestEmailVerify(req.Email)
|
||||
template, err := static.RenderTemplate("email/verification-code.tmpl", map[string]interface{}{})
|
||||
template, err := static.RenderTemplate("email/verification-code.tmpl", map[string]interface{}{
|
||||
"Title": "NEO-BLOG",
|
||||
"Email": req.Email,
|
||||
"VerifyCode": verifyCode,
|
||||
"Expire": 10,
|
||||
"Details": "你正在验证电子邮件所有权",
|
||||
})
|
||||
if err != nil {
|
||||
return nil, errs.ErrInternalServer
|
||||
}
|
||||
|
Reference in New Issue
Block a user