|
|
|
@ -85,4 +85,150 @@ $(function() {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
})*/
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 密码强度动态验证
|
|
|
|
|
* @param passName
|
|
|
|
|
* @constructor
|
|
|
|
|
*/
|
|
|
|
|
function AnalyzePasswordSecurityLevel(passName) {
|
|
|
|
|
debugger
|
|
|
|
|
var password =$("#"+passName).val();
|
|
|
|
|
var pwdArray = new Array();
|
|
|
|
|
var securityLevelFlag = 0;
|
|
|
|
|
if (passName == "newReUserPwd") {
|
|
|
|
|
if(password == $("#newUserPwd").val()){
|
|
|
|
|
if (password.length < 8) {
|
|
|
|
|
if (passName == "newUserPwd"){
|
|
|
|
|
$("#newUserPwdText").text("");
|
|
|
|
|
$("#newUserPwdText").text("密码长度不能小于8位");
|
|
|
|
|
}
|
|
|
|
|
if (passName == "newReUserPwd") {
|
|
|
|
|
$("#newReUserPwdText").text("");
|
|
|
|
|
$("#newReUserPwdText").text("密码长度不能小于8位");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
var securityLevelFlagArray = new Array(0, 0, 0, 0);
|
|
|
|
|
for (var i = 0; i < password.length; i++) {
|
|
|
|
|
var asciiNumber = password.substr(i, 1).charCodeAt();
|
|
|
|
|
if (asciiNumber >= 48 && asciiNumber <= 57) {
|
|
|
|
|
securityLevelFlagArray[0] = 1; //digital
|
|
|
|
|
}
|
|
|
|
|
else if (asciiNumber >= 97 && asciiNumber <= 122) {
|
|
|
|
|
securityLevelFlagArray[1] = 1; //lowercase
|
|
|
|
|
}
|
|
|
|
|
else if (asciiNumber >= 65 && asciiNumber <= 90) {
|
|
|
|
|
securityLevelFlagArray[2] = 1; //uppercase
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
securityLevelFlagArray[3] = 1; //specialcase
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (var i = 0; i < securityLevelFlagArray.length; i++) {
|
|
|
|
|
if (securityLevelFlagArray[i] == 1) {
|
|
|
|
|
securityLevelFlag++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (passName == "newUserPwd"){
|
|
|
|
|
if (securityLevelFlag == 1){
|
|
|
|
|
$("#newUserPwdText").text("");
|
|
|
|
|
$("#newUserPwdText").text("密码安全低");
|
|
|
|
|
}
|
|
|
|
|
if (securityLevelFlag == 2 || securityLevelFlag == 3){
|
|
|
|
|
$("#newUserPwdText").text("");
|
|
|
|
|
$("#newUserPwdText").text("密码安全中等");
|
|
|
|
|
}
|
|
|
|
|
if (securityLevelFlag == 4){
|
|
|
|
|
$("#newUserPwdText").text("");
|
|
|
|
|
$("#newUserPwdText").text("密码安全高");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (passName == "newReUserPwd") {
|
|
|
|
|
if (securityLevelFlag == 1){
|
|
|
|
|
$("#newReUserPwdText").text("");
|
|
|
|
|
$("#newReUserPwdText").text("密码安全低");
|
|
|
|
|
}
|
|
|
|
|
if (securityLevelFlag == 2 || securityLevelFlag == 3){
|
|
|
|
|
$("#newReUserPwdText").text("");
|
|
|
|
|
$("#newReUserPwdText").text("密码安全中等");
|
|
|
|
|
}
|
|
|
|
|
if (securityLevelFlag == 4){
|
|
|
|
|
$("#newReUserPwdText").text("");
|
|
|
|
|
$("#newReUserPwdText").text("密码安全高");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
$("#newReUserPwdText").text("");
|
|
|
|
|
$("#newReUserPwdText").text("两次密码不相同");
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (password.length < 8) {
|
|
|
|
|
if (passName == "newUserPwd"){
|
|
|
|
|
$("#newUserPwdText").text("");
|
|
|
|
|
$("#newUserPwdText").text("密码长度不能小于8位");
|
|
|
|
|
}
|
|
|
|
|
if (passName == "newReUserPwd") {
|
|
|
|
|
$("#newReUserPwdText").text("");
|
|
|
|
|
$("#newReUserPwdText").text("密码长度不能小于8位");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
var securityLevelFlagArray = new Array(0, 0, 0, 0);
|
|
|
|
|
for (var i = 0; i < password.length; i++) {
|
|
|
|
|
var asciiNumber = password.substr(i, 1).charCodeAt();
|
|
|
|
|
if (asciiNumber >= 48 && asciiNumber <= 57) {
|
|
|
|
|
securityLevelFlagArray[0] = 1; //digital
|
|
|
|
|
}
|
|
|
|
|
else if (asciiNumber >= 97 && asciiNumber <= 122) {
|
|
|
|
|
securityLevelFlagArray[1] = 1; //lowercase
|
|
|
|
|
}
|
|
|
|
|
else if (asciiNumber >= 65 && asciiNumber <= 90) {
|
|
|
|
|
securityLevelFlagArray[2] = 1; //uppercase
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
securityLevelFlagArray[3] = 1; //specialcase
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (var i = 0; i < securityLevelFlagArray.length; i++) {
|
|
|
|
|
if (securityLevelFlagArray[i] == 1) {
|
|
|
|
|
securityLevelFlag++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (passName == "newUserPwd"){
|
|
|
|
|
if (securityLevelFlag == 1){
|
|
|
|
|
$("#newUserPwdText").text("");
|
|
|
|
|
$("#newUserPwdText").text("密码安全低");
|
|
|
|
|
}
|
|
|
|
|
if (securityLevelFlag == 2 || securityLevelFlag == 3){
|
|
|
|
|
$("#newUserPwdText").text("");
|
|
|
|
|
$("#newUserPwdText").text("密码安全中等");
|
|
|
|
|
}
|
|
|
|
|
if (securityLevelFlag == 4){
|
|
|
|
|
$("#newUserPwdText").text("");
|
|
|
|
|
$("#newUserPwdText").text("密码安全高");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (passName == "newReUserPwd") {
|
|
|
|
|
if (securityLevelFlag == 1){
|
|
|
|
|
$("#newReUserPwdText").text("");
|
|
|
|
|
$("#newReUserPwdText").text("密码安全低");
|
|
|
|
|
}
|
|
|
|
|
if (securityLevelFlag == 2 || securityLevelFlag == 3){
|
|
|
|
|
$("#newReUserPwdText").text("");
|
|
|
|
|
$("#newReUserPwdText").text("密码安全中等");
|
|
|
|
|
}
|
|
|
|
|
if (securityLevelFlag == 4){
|
|
|
|
|
$("#newReUserPwdText").text("");
|
|
|
|
|
$("#newReUserPwdText").text("密码安全高");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|