用户密码支持自定义配置规则

This commit is contained in:
RuoYi
2020-08-03 11:40:51 +08:00
parent 3d2d88287a
commit 8bf5140a72
7 changed files with 58 additions and 5 deletions

View File

@ -347,6 +347,32 @@ function calSumWidth(elements) {
return width;
}
/** 密码规则范围验证 */
function checkpwd(chrtype, password) {
if (chrtype == 1) {
if(!$.common.numValid(password)){
$.modal.alertWarning("密码只能为0-9数字");
return false;
}
} else if (chrtype == 2) {
if(!$.common.enValid(password)){
$.modal.alertWarning("密码只能为a-z和A-Z字母");
return false;
}
} else if (chrtype == 3) {
if(!$.common.enNumValid(password)){
$.modal.alertWarning("密码必须包含字母以及数字");
return false;
}
} else if (chrtype == 4) {
if(!$.common.charValid(password)){
$.modal.alertWarning("密码必须包含字母、数字、以及特殊符号-、_");
return false;
}
}
return true;
}
// 日志打印封装处理
var log = {
log: function(msg) {