diff --git a/opsli-api/src/main/java/org/opsli/api/wrapper/system/user/UserAndOrgModel.java b/opsli-api/src/main/java/org/opsli/api/wrapper/system/user/UserAndOrgModel.java index 09191a1..382e269 100644 --- a/opsli-api/src/main/java/org/opsli/api/wrapper/system/user/UserAndOrgModel.java +++ b/opsli-api/src/main/java/org/opsli/api/wrapper/system/user/UserAndOrgModel.java @@ -23,6 +23,7 @@ import lombok.EqualsAndHashCode; import org.opsli.api.base.warpper.ApiWrapper; import org.opsli.common.annotation.validation.ValidationArgs; import org.opsli.common.annotation.validation.ValidationArgsLenMax; +import org.opsli.common.annotation.validation.ValidationArgsLenMin; import org.opsli.common.enums.ValiArgsType; import org.opsli.plugins.excel.annotation.ExcelInfo; @@ -50,6 +51,7 @@ public class UserAndOrgModel extends ApiWrapper { @ApiModelProperty(value = "登录密码") @ExcelIgnore // 验证器 + @ValidationArgsLenMin(6) @ValidationArgsLenMax(50) private String password; diff --git a/opsli-api/src/main/java/org/opsli/api/wrapper/system/user/UserModel.java b/opsli-api/src/main/java/org/opsli/api/wrapper/system/user/UserModel.java index e5e70ba..ec76384 100644 --- a/opsli-api/src/main/java/org/opsli/api/wrapper/system/user/UserModel.java +++ b/opsli-api/src/main/java/org/opsli/api/wrapper/system/user/UserModel.java @@ -23,6 +23,7 @@ import lombok.EqualsAndHashCode; import org.opsli.api.base.warpper.ApiWrapper; import org.opsli.common.annotation.validation.ValidationArgs; import org.opsli.common.annotation.validation.ValidationArgsLenMax; +import org.opsli.common.annotation.validation.ValidationArgsLenMin; import org.opsli.common.enums.ValiArgsType; import org.opsli.plugins.excel.annotation.ExcelInfo; @@ -50,6 +51,7 @@ public class UserModel extends ApiWrapper { @ApiModelProperty(value = "登录密码") @ExcelIgnore // 验证器 + @ValidationArgsLenMin(6) @ValidationArgsLenMax(50) private String password; diff --git a/opsli-api/src/main/java/org/opsli/api/wrapper/system/user/UserPassword.java b/opsli-api/src/main/java/org/opsli/api/wrapper/system/user/UserPassword.java index b533e0d..69a87a4 100644 --- a/opsli-api/src/main/java/org/opsli/api/wrapper/system/user/UserPassword.java +++ b/opsli-api/src/main/java/org/opsli/api/wrapper/system/user/UserPassword.java @@ -22,6 +22,7 @@ import lombok.Data; import lombok.EqualsAndHashCode; import org.opsli.common.annotation.validation.ValidationArgs; import org.opsli.common.annotation.validation.ValidationArgsLenMax; +import org.opsli.common.annotation.validation.ValidationArgsLenMin; import org.opsli.common.enums.ValiArgsType; import java.io.Serializable; @@ -48,6 +49,7 @@ public class UserPassword implements Serializable { @ApiModelProperty(value = "旧密码") // 验证器 @ValidationArgs({ValiArgsType.IS_NOT_NULL}) + @ValidationArgsLenMin(6) @ValidationArgsLenMax(50) private String oldPassword; @@ -55,6 +57,7 @@ public class UserPassword implements Serializable { @ApiModelProperty(value = "新密码") // 验证器 @ValidationArgs({ValiArgsType.IS_NOT_NULL}) + @ValidationArgsLenMin(6) @ValidationArgsLenMax(50) private String newPassword; diff --git a/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/SystemMsg.java b/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/SystemMsg.java index fcc6049..fafbc9a 100644 --- a/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/SystemMsg.java +++ b/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/SystemMsg.java @@ -51,13 +51,13 @@ public enum SystemMsg implements BaseMsg { */ EXCEPTION_USER_UNIQUE(20300,"该用户已存在"), EXCEPTION_USER_PASSWORD_ERROR(20301,"旧密码不正确"), - EXCEPTION_USER_ID_NOT_NULL(20302,"用户Id不可为空"), - EXCEPTION_USER_ROLES_ERROR(20303,"用户角色设置失败"), - EXCEPTION_USER_MENU_NOT_NULL(20304,"用户暂无角色菜单,请设置后登录"), - EXCEPTION_USER_NO_UNIQUE(20305,"该工号已存在"), - EXCEPTION_ORG_NOT_NULL(20306,"组织不可为空"), - EXCEPTION_USER_ORG_ERROR(20307,"用户组织设置失败"), - + EXCEPTION_USER_PASSWORD_EQ_ERROR(20302,"旧密码不可以等于新密码"), + EXCEPTION_USER_ID_NOT_NULL(20303,"用户Id不可为空"), + EXCEPTION_USER_ROLES_ERROR(20304,"用户角色设置失败"), + EXCEPTION_USER_MENU_NOT_NULL(20305,"用户暂无角色菜单,请设置后登录"), + EXCEPTION_USER_NO_UNIQUE(20306,"该工号已存在"), + EXCEPTION_ORG_NOT_NULL(20307,"组织不可为空"), + EXCEPTION_USER_ORG_ERROR(20308,"用户组织设置失败"), /** diff --git a/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/user/service/impl/UserServiceImpl.java b/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/user/service/impl/UserServiceImpl.java index 2d9fcba..f6caaf7 100644 --- a/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/user/service/impl/UserServiceImpl.java +++ b/opsli-modulars/opsli-modulars-system/src/main/java/org/opsli/modulars/system/user/service/impl/UserServiceImpl.java @@ -276,6 +276,12 @@ public class UserServiceImpl extends CrudServiceImpl