|
@@ -134,12 +134,6 @@ function bindModalEvent(){
|
|
|
$("#oldWord").off("input").on("input",function(){
|
|
|
const text = $(this).val();
|
|
|
$(".oldWaring.warning,.newword.warning").hide();
|
|
|
- /*if($(".oldWaring.warning:visible").length){//有修改则隐藏报错
|
|
|
- $(".oldWaring.warning").hide();
|
|
|
- if(!$(".waring:visible").length){ //无报错则激活保存按钮
|
|
|
- $(".alertModal .sureChange").addClass("active");
|
|
|
- }
|
|
|
- }*/
|
|
|
verifyPsdPart();
|
|
|
if(text.trim()){
|
|
|
$("#newWord").attr("disabled",false);
|
|
@@ -148,7 +142,7 @@ function bindModalEvent(){
|
|
|
$("#newWord").off("input").on("input",function(){
|
|
|
const text = $(this).val();
|
|
|
const checker = $(".alertModal .psd-checkbox");
|
|
|
- $(".oldWaring.warning,.newword.warning").hide();
|
|
|
+ $(".newword.warning,.sureword.warning").hide();
|
|
|
if(text.trim()){ //显示密码验证标签
|
|
|
if(checker.length){
|
|
|
checker.show()
|
|
@@ -190,43 +184,49 @@ function bindModalEvent(){
|
|
|
|
|
|
//验证新密码规则
|
|
|
function verifyPsd(text){
|
|
|
+ let pass = true;
|
|
|
if(/(?=.*?[A-Z])/.test(text)){ //至少一个大写字母
|
|
|
$(".big-letter").addClass("active");
|
|
|
}else{
|
|
|
$(".big-letter").removeClass("active");
|
|
|
+ pass=false;
|
|
|
}
|
|
|
if(/(?=.*?[a-z])/.test(text)){ //至少一个大写字母
|
|
|
$(".small-letter").addClass("active");
|
|
|
}else{
|
|
|
$(".small-letter").removeClass("active");
|
|
|
+ pass=false;
|
|
|
}
|
|
|
if(/(?=.*?[0-9])/.test(text)){ //至少一个数字
|
|
|
$(".one-number").addClass("active");
|
|
|
}else{
|
|
|
$(".one-number").removeClass("active");
|
|
|
+ pass=false;
|
|
|
}
|
|
|
if(/(?=.*?[#?!@$,,%^&*-])/.test(text)){ //至少一个特殊字符
|
|
|
$(".special-letter").addClass("active");
|
|
|
}else{
|
|
|
$(".special-letter").removeClass("active");
|
|
|
+ pass=false;
|
|
|
}
|
|
|
if(text.length>7){ //至少8个字符
|
|
|
$(".eight-str").addClass("active");
|
|
|
}else{
|
|
|
$(".eight-str").removeClass("active");
|
|
|
+ pass=false;
|
|
|
}
|
|
|
- /*if(text.length>12){
|
|
|
+ if(text.length>12){
|
|
|
$(".newword.warning b").text("密码最多12位");
|
|
|
$(".newword.warning").show();
|
|
|
- return false;
|
|
|
+ pass=false;
|
|
|
}else{
|
|
|
$(".newword.warning").hide();
|
|
|
- }*/
|
|
|
- const regex = new RegExp('^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[$@~^·$、,,\.!#%*?&])[A-Za-z\\d$@#$\.~、,,·!%*?&]{8,12}');
|
|
|
- if(regex.test(text)){
|
|
|
- return true
|
|
|
}
|
|
|
- return false;
|
|
|
+ //const regex = new RegExp('^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[$@~^·$、,,\.!#%*?&])[A-Za-z\\d$@#$\.~、,,·!%*?&]{8,12}');
|
|
|
+ /*if(regex.test(text)){
|
|
|
+ return true
|
|
|
+ }*/
|
|
|
+ return pass;
|
|
|
}
|
|
|
|
|
|
function verifyPsdPart(){ //验证各密码关系规则
|