Password complexity public function encapsulation (mailbox, mobile number)
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;
}
}
Mobile phone number Verification
This. Phonenumbervalidation = function (phonenum) {
if (/^1[3,4,5,7,8]\d{9}$/.test (Phonenum)) {
return true;
} else {
return false;
}
}
Email account Verification
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;
}
}
Enter Amount validation
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;
}
}
Common public Function encapsulation methods (password strength, phone number verification, mailbox verification, input amount verification)