用户密码长度校验

dep_wangsr
RuoYi 7 years ago committed by Limy
parent 14e8a8e922
commit b6b252f4f7

@ -27,7 +27,7 @@ public class UserConstants
* *
*/ */
public static final int USERNAME_MIN_LENGTH = 2; public static final int USERNAME_MIN_LENGTH = 2;
public static final int USERNAME_MAX_LENGTH = 10; public static final int USERNAME_MAX_LENGTH = 20;
/** 名称是否唯一的返回结果码 */ /** 名称是否唯一的返回结果码 */
public final static String NAME_UNIQUE = "0"; public final static String NAME_UNIQUE = "0";

@ -3,6 +3,7 @@ $("#form-user-add").validate({
loginName:{ loginName:{
required:true, required:true,
minlength: 2, minlength: 2,
maxlength: 20,
remote: { remote: {
url: ctx + "system/user/checkUserNameUnique", url: ctx + "system/user/checkUserNameUnique",
type: "post", type: "post",
@ -26,7 +27,8 @@ $("#form-user-add").validate({
}, },
password:{ password:{
required:true, required:true,
minlength: 6 minlength: 5,
maxlength: 20
}, },
email:{ email:{
required:true, required:true,

@ -6,10 +6,6 @@ $("#form-user-edit").validate({
deptName:{ deptName:{
required:true, required:true,
}, },
password:{
required:true,
minlength: 6
},
email:{ email:{
required:true, required:true,
email:true email:true
@ -27,7 +23,6 @@ function update() {
var userId = $("input[name='userId']").val(); var userId = $("input[name='userId']").val();
var deptId = $("input[name='deptId']").val(); var deptId = $("input[name='deptId']").val();
var userName = $("input[name='userName']").val(); var userName = $("input[name='userName']").val();
var password = $("input[name='password']").val();
var email = $("input[name='email']").val(); var email = $("input[name='email']").val();
var phonenumber = $("input[name='phonenumber']").val(); var phonenumber = $("input[name='phonenumber']").val();
var sex = $("input[name='sex']:checked").val(); var sex = $("input[name='sex']:checked").val();
@ -42,7 +37,6 @@ function update() {
"userId": userId, "userId": userId,
"deptId": deptId, "deptId": deptId,
"userName": userName, "userName": userName,
"password": password,
"email": email, "email": email,
"phonenumber": phonenumber, "phonenumber": phonenumber,
"sex": sex, "sex": sex,

@ -65,10 +65,6 @@
userName:{ userName:{
required:true, required:true,
}, },
password:{
required:true,
minlength: 6
},
email:{ email:{
required:true, required:true,
email:true email:true

@ -45,7 +45,6 @@
rules:{ rules:{
oldPassword:{ oldPassword:{
required:true, required:true,
minlength: 6,
remote: { remote: {
url: ctx + "system/user/profile/checkPassword", url: ctx + "system/user/profile/checkPassword",
type: "get", type: "get",
@ -59,7 +58,8 @@
}, },
password: { password: {
required: true, required: true,
minlength: 6 minlength: 5,
maxlength: 20
}, },
confirm: { confirm: {
required: true, required: true,
@ -73,7 +73,8 @@
}, },
password: { password: {
required: "请输入新密码", required: "请输入新密码",
minlength: "密码不能小于6个字符" minlength: "密码不能小于6个字符",
maxlength: "密码不能大于20个字符"
}, },
confirm: { confirm: {
required: "请再次输入新密码", required: "请再次输入新密码",

@ -33,7 +33,8 @@
rules:{ rules:{
password:{ password:{
required:true, required:true,
minlength: 6 minlength: 5,
maxlength: 20
}, },
}, },
submitHandler:function(form){ submitHandler:function(form){

Loading…
Cancel
Save