//密码复杂度公共函数封装(邮箱,手机号)
this.PasswordStrength = function(password) {
var rule = Auto517.config.passwordRule.rule;
var min = Auto517.config.passwordRule.min;
var max = Auto517.config.passwordRule.max;
if(rule == 0 && eval(‘/^[0-9]{‘ + min + ‘,‘ + max + ‘}$/.test(password)‘)) {
return true;
} else if(rule == 1 && eval(‘/^[a-zA-Z]{‘ + min + ‘,‘ + max + ‘}$/.test(password)‘)) {
return true;
} else if(rule == 2 && eval(‘/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{‘ + min + ‘,‘ + max + ‘}$/.test(password)‘)) {
return true;
} else {
return false;
}
}
//手机号验证
this.PhoneNumberValidation = function(phonenum) {
if(/^1[3,4,5,7,8]\d{9}$/.test(phonenum)) {
return true;
} else {
return false;
}
}
//邮箱账号验证
this.MailboxValidate = function(email) {
if(/^[_\.0-9a-zA-Z-][email protected]([0-9a-z][0-9a-z-]+\.){1,4}[a-z]{2,3}$/.test(email)) {
return true;
} else {
return false;
}
}
//输入金额验证
this.EnterTheAmount = function(money) {
var rule = Auto517.config.moneyRule.rule;
var min = Auto517.config.moneyRule.min;
if(rule == 0 && /^[0-9]+(.[0-9]{1,2})?$/.test(money)) {
if(money >= min) {
return true;
} else {
return false;
}
} else if(rule == 1 && /^\+?[1-9][0-9]*$/.test(money)) {
if(money >= min) {
return true;
} else {
return false;
}
} else {
return false;
}
}