Browse Source

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

RuoYi 4 năm trước cách đây
mục cha
commit
43788e0590

+ 1 - 1
ruoyi-admin/src/main/resources/templates/system/user/add.html

@@ -221,7 +221,7 @@
         });
         
         function submitHandler() {
-        	var chrtype = [[${@config.getKey('sys.account.chrtype')}]];
+        	var chrtype = [[${#strings.defaultString(@config.getKey('sys.account.chrtype'), 0)}]];
 			var password = $("#password").val();
 	        if ($.validate.form() && checkpwd(chrtype, password)) {
 	        	var data = $("#form-user-add").serializeArray();

+ 1 - 1
ruoyi-admin/src/main/resources/templates/system/user/profile/profile.html

@@ -283,7 +283,7 @@
 		});
 		
 		function submitChangPassword () {
-			var chrtype = [[${@config.getKey('sys.account.chrtype')}]];
+			var chrtype = [[${#strings.defaultString(@config.getKey('sys.account.chrtype'), 0)}]];
 			var password = $("#newPassword").val();
 	        if ($.validate.form("form-user-resetPwd") && checkpwd(chrtype, password)) {
 	        	$.operate.saveModal(ctx + "system/user/profile/resetPwd", $('#form-user-resetPwd').serialize());

+ 1 - 1
ruoyi-admin/src/main/resources/templates/system/user/profile/resetPwd.html

@@ -82,7 +82,7 @@
 		});
 		
 		function submitHandler() {
-			var chrtype = [[${@config.getKey('sys.account.chrtype')}]];
+			var chrtype = [[${#strings.defaultString(@config.getKey('sys.account.chrtype'), 0)}]];
 			var password = $("#newPassword").val();
 	        if ($.validate.form() && checkpwd(chrtype, password)) {
 	        	$.operate.save(ctx + "system/user/profile/resetPwd", $('#form-user-resetPwd').serialize());

+ 1 - 1
sql/ry_20200803.sql

@@ -535,7 +535,7 @@ insert into sys_config values(1, '主框架页-默认皮肤样式名称',     's
 insert into sys_config values(2, '用户管理-账号初始密码',         'sys.user.initPassword',    '123456',        'Y', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '初始化密码 123456');
 insert into sys_config values(3, '主框架页-侧边栏主题',           'sys.index.sideTheme',      'theme-dark',    'Y', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '深黑主题theme-dark,浅色主题theme-light,深蓝主题theme-blue');
 insert into sys_config values(4, '账号自助-是否开启用户注册功能', 'sys.account.registerUser', 'false',         'Y', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '是否开启注册用户功能');
-insert into sys_config values(5, '用户管理-密码字符范围',         'sys.account.chrtype',      '0',             'Y', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '默认任意字符范围,0任意(密码可以输入任意字符),1数字(密码只能为0-9数字),2英文字母(密码只能为a-z和A-Z字母),3字母和数字(密码必须包含字母,数字),4字母数组和特殊字符(密码包含字母,数字,特殊字符-_)');
+insert into sys_config values(5, '用户管理-密码字符范围',         'sys.account.chrtype',      '0',             'Y', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '默认任意字符范围,0任意(密码可以输入任意字符),1数字(密码只能为0-9数字),2英文字母(密码只能为a-z和A-Z字母),3字母和数字(密码必须包含字母,数字),4字母数组和特殊字符(密码必须包含字母,数字,特殊字符-_)');
 
 
 -- ----------------------------