This commit is contained in:
李子铭 2024-11-21 09:37:33 +08:00
parent f8a8d9459b
commit 407f71d208
2 changed files with 0 additions and 9 deletions

View File

@ -15,8 +15,6 @@ func (o AccountType) AccountType(account string) AccountType {
return AccountTypeDefault
} else if helper.IsPhoneNumber(account) {
return AccountTypePhone
} else if helper.IsValidQQ(account) {
return AccountTypeQQ
}
return AccountTypeDefault
}

View File

@ -30,10 +30,3 @@ func IsEmail(email string) bool {
var emailRegex = regexp.MustCompile(`[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`)
return emailRegex.MatchString(email)
}
// IsValidQQ 检查给定的字符串是否为有效的 QQ 号
func IsValidQQ(qq string) bool {
// QQ号正则表达式5到11位数字且开头不为0的情况
re := regexp.MustCompile(`^(?!0)[0-9]{5,11}$`)
return re.MatchString(qq)
}