chore: trash

This commit is contained in:
deepzz0
2021-04-27 18:04:59 +08:00
parent 63b55b2df8
commit a39e3aac3b
8 changed files with 423 additions and 26 deletions

23
tools/validate.go Normal file
View File

@@ -0,0 +1,23 @@
// Package tools provides ...
package tools
import "regexp"
var regexpEmail = regexp.MustCompile(`^(\w)+([\.\-]\w+)*@(\w)+((\.\w+)+)$`)
// ValidateEmail 校验邮箱
func ValidateEmail(e string) bool {
return regexpEmail.MatchString(e)
}
var regexpPhoneNo = regexp.MustCompile(`^\+\d+$`)
// ValidatePhoneNo 校验手机号
func ValidatePhoneNo(no string) bool {
return regexpPhoneNo.MatchString(no)
}
// ValidatePassword 校验米阿莫
func ValidatePassword(pwd string) bool {
return len(pwd) > 5 && len(pwd) < 32
}