mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 11:10:57 +00:00
commit
1923b8c767
@ -280,6 +280,18 @@ func TestMobile(t *testing.T) {
|
||||
if valid.Mobile("8617400008888", "mobile").Ok {
|
||||
t.Error("\"8617400008888\" is a valid mobile phone number should be false")
|
||||
}
|
||||
if !valid.Mobile("16200008888", "mobile").Ok {
|
||||
t.Error("\"16200008888\" is a valid mobile phone number should be true")
|
||||
}
|
||||
if !valid.Mobile("16500008888", "mobile").Ok {
|
||||
t.Error("\"16500008888\" is a valid mobile phone number should be true")
|
||||
}
|
||||
if !valid.Mobile("16600008888", "mobile").Ok {
|
||||
t.Error("\"16600008888\" is a valid mobile phone number should be true")
|
||||
}
|
||||
if !valid.Mobile("16700008888", "mobile").Ok {
|
||||
t.Error("\"16700008888\" is a valid mobile phone number should be true")
|
||||
}
|
||||
}
|
||||
|
||||
func TestTel(t *testing.T) {
|
||||
|
@ -632,7 +632,7 @@ func (b Base64) GetLimitValue() interface{} {
|
||||
}
|
||||
|
||||
// just for chinese mobile phone number
|
||||
var mobilePattern = regexp.MustCompile(`^((\+86)|(86))?(1(([35][0-9])|[8][0-9]|[7][01356789]|[4][579]))\d{8}$`)
|
||||
var mobilePattern = regexp.MustCompile(`^((\+86)|(86))?(1(([35][0-9])|[8][0-9]|[7][01356789]|[4][579]|[6][2567]))\d{8}$`)
|
||||
|
||||
// Mobile check struct
|
||||
type Mobile struct {
|
||||
|
Loading…
Reference in New Issue
Block a user