增加二级等保密码校验

This commit is contained in:
duxp 2024-01-22 11:40:41 +08:00
parent 5220bb806c
commit 9a15c52b4b
5 changed files with 17 additions and 6 deletions

View File

@ -4,7 +4,12 @@ $(document).ready(function(){
submitHandler: function(form) {
form.submit();
}
});
});
//密码校验 密码必须是数字、字母和特殊字符的组合长度至少为8位
jQuery.validator.addMethod("isPassword", function (value, element) {
var isPassword = /^(?=.*[a-z])(?=.*\d)(?=.*[@$!%*#?&]){8,}/;
return this.optional(element) || (isPassword.test(value));
}, "密码必须是数字、字母和特殊字符的组合长度至少为8位");
//手机号码验证身份证正则合并:(^\d{15}$)|(^\d{17}([0-9]|X)$)
jQuery.validator.addMethod("isPhone",function(value,element){
var length = value.length;

View File

@ -33,9 +33,9 @@ function login() {
if (r.code == web_status.SUCCESS) {
location.href = ctx + 'index';
} else {
$('.imgcode').click();
$(".code").val("");
$.modal.msg(r.msg);
$('.imgcode').click();
$(".code").val("");
$.modal.msg(r.msg);
}
$.modal.closeLoading();
}
@ -50,7 +50,8 @@ function validateRule() {
required: true
},
password: {
required: true
required: true,
isPassword:true
}
},
messages: {

View File

@ -37,6 +37,7 @@
<h4 class="no-margins" style="font-size: 22px">请登录:业务绩效考核系统</h4>
<input class="form-control uname" name="username" placeholder="用户名" type="text" value=""/>
<input class="form-control pword" name="password" placeholder="密码" type="password" value=""/>
<div style="margin-top: 10px">温馨提示密码必须是数字、字母和特殊字符的组合长度至少为8位</div>
<div class="row m-t" th:if="${captchaEnabled==true}">
<div class="col-xs-6">
<input class="form-control code" maxlength="5" name="validateCode" placeholder="验证码"
@ -66,5 +67,6 @@
<script src="../static/ajax/libs/blockUI/jquery.blockUI.js" th:src="@{/ajax/libs/blockUI/jquery.blockUI.js}"></script>
<script src="../static/ruoyi/js/ry-ui.js" th:src="@{/ruoyi/js/ry-ui.js?v=4.7.7}"></script>
<script src="../static/ruoyi/login.js" th:src="@{/ruoyi/login.js}"></script>
<script src="../static/ajax/libs/validate/jquery.validate.extend.js" th:src="@{/ajax/libs/validate/jquery.validate.extend.js}"></script>
</body>
</html>

View File

@ -193,7 +193,8 @@
},
password:{
minlength: 5,
maxlength: 20
maxlength: 20,
isPassword:true,
},
email:{
email:true,

View File

@ -51,6 +51,7 @@
rules:{
oldPassword:{
required:true,
isPassword:true,
remote: {
url: ctx + "system/user/profile/checkPassword",
type: "get",
@ -64,6 +65,7 @@
},
newPassword: {
required: true,
isPassword:true,
minlength: 5,
maxlength: 20
},