fix: check cn phone regex bug and add check to verification code

Signed-off-by: Kininaru <shiftregister233@outlook.com>
This commit is contained in:
Kininaru
2021-05-13 09:55:37 +08:00
parent 892cb39e3e
commit 1589da0a62
5 changed files with 16 additions and 7 deletions

View File

@ -17,7 +17,6 @@ package object
import (
"fmt"
"math/rand"
"strings"
"time"
)
@ -30,9 +29,6 @@ type VerificationRecord struct {
}
func SendVerificationCodeToEmail(remoteAddr, dest string) string {
if strings.Index(dest, "@") < 0 {
return "Invalid Email address"
}
title := "Casdoor Code"
sender := "Casdoor Admin"
code := getRandomCode(5)