diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserBLL.cs b/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserBLL.cs index 05ce2d85a..09f6c3d59 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserBLL.cs @@ -955,7 +955,7 @@ namespace Learun.Application.Organization { cache.Remove(cacheKeyId + item, CacheId.user); } - string password = Md5Helper.Encrypt(ConfigurationManager.AppSettings["pwdprex"] + ConfigurationManager.AppSettings["defaultpwd"], 32).ToLower(); + string password = Md5Helper.Encrypt(ConfigurationManager.AppSettings["pwdprex"] + ConfigurationManager.AppSettings["pwdsuff"], 32).ToLower(); userService.RevisePasswordBatch(keyValue, password); } catch (Exception ex) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserService.cs b/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserService.cs index cb9e756c3..154bcae6c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserService.cs @@ -549,7 +549,7 @@ namespace Learun.Application.Organization { userEntity.Modify(userModel.F_UserId); userEntity.F_Secretkey = Md5Helper.Encrypt(CommonHelper.CreateNo(), 16).ToLower(); - if (!string.IsNullOrEmpty(userModel.F_IdentityCardNo)) + if (!string.IsNullOrEmpty(userModel.F_IdentityCardNo) && userModel.F_IdentityCardNo.Length >= 6) { //密码规则:前缀+身份证后6位 password = Md5Helper.Encrypt(ConfigurationManager.AppSettings["pwdprex"] + userModel.F_IdentityCardNo.Substring(userModel.F_IdentityCardNo.Length - 6, 6), 32).ToLower(); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/LoginController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/LoginController.cs index 74ab086d2..db903e9bb 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/LoginController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/LoginController.cs @@ -631,21 +631,21 @@ namespace Learun.Application.Web.Controllers } } //是否初始密码 - if (string.IsNullOrEmpty(userEntity.F_IdentityCardNo)) + if (!string.IsNullOrEmpty(userEntity.F_IdentityCardNo) && userEntity.F_IdentityCardNo.Length >= 6) { - if (password == Md5Helper.Encrypt(Config.GetValue("pwdprex") + "123456", 32) || password == Md5Helper.Encrypt(Config.GetValue("pwdprex") + "2020", 32) || password == Md5Helper.Encrypt(Config.GetValue("defaultpwd"), 32)) + if (password == Md5Helper.Encrypt(Config.GetValue("pwdprex") + userEntity.F_IdentityCardNo.Substring(userEntity.F_IdentityCardNo.Length - 6, 6), 32) || password == Md5Helper.Encrypt(Config.GetValue("pwdprex") + "2020", 32) || password == Md5Helper.Encrypt(Config.GetValue("defaultpwd"), 32)) { succresult.pwd = true; } } else { - if (password == Md5Helper.Encrypt(Config.GetValue("pwdprex") + userEntity.F_IdentityCardNo.Substring(userEntity.F_IdentityCardNo.Length - 6, 6), 32) || password == Md5Helper.Encrypt(Config.GetValue("pwdprex") + "2020", 32) || password == Md5Helper.Encrypt(Config.GetValue("defaultpwd"), 32)) + if (password == Md5Helper.Encrypt(Config.GetValue("pwdprex") + Config.GetValue("pwdsuff"), 32) || password == Md5Helper.Encrypt(Config.GetValue("pwdprex") + "2020", 32) || password == Md5Helper.Encrypt(Config.GetValue("defaultpwd"), 32)) { succresult.pwd = true; } } - + return Success(succresult); } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config b/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config index 54e515c5d..f03afee23 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config @@ -101,6 +101,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/EmpInfo/EmpInfoService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/EmpInfo/EmpInfoService.cs index 5ebd2ffac..a6693446a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/EmpInfo/EmpInfoService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/EmpInfo/EmpInfoService.cs @@ -406,7 +406,7 @@ sum(case when DATEDIFF(YYYY, t.Birthday, GETDATE()) > 20 and DATEDIFF(YYYY, t.Bi userbase.F_Account = tEntity.EmpNo; userbase.F_RealName = tEntity.EmpName; userbase.F_EnCode = tEntity.EmpNo; - userbase.F_Password = string.IsNullOrEmpty(tEntity.IdentityCardNo) ? Md5Helper.Encrypt(Config.GetValue("pwdprex") + Config.GetValue("defaultpwd"), 32).ToLower() : Md5Helper.Encrypt(Config.GetValue("pwdprex") + tEntity.IdentityCardNo.Substring(tEntity.IdentityCardNo.Length - 6, 6), 32).ToLower(); + userbase.F_Password = (!string.IsNullOrEmpty(tEntity.IdentityCardNo) && tEntity.IdentityCardNo.Length >= 6) ? Md5Helper.Encrypt(Config.GetValue("pwdprex") + tEntity.IdentityCardNo.Substring(tEntity.IdentityCardNo.Length - 6, 6), 32).ToLower() : Md5Helper.Encrypt(Config.GetValue("pwdprex") + Config.GetValue("pwdsuff"), 32).ToLower(); userbase.F_HeadIcon = string.IsNullOrEmpty(url) ? Config.GetValue("defaultheadimg") : url; userbase.F_Gender = tEntity.GenderNo.HasValue ? Convert.ToInt32(tEntity.GenderNo.Value) : 1; userbase.F_DeleteMark = 0; diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicService.cs index 8af305167..504288bfa 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicService.cs @@ -777,7 +777,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration userbase.F_Account = tEntity.StuNo; userbase.F_RealName = tEntity.StuName; userbase.F_EnCode = tEntity.StuNo; - userbase.F_Password = string.IsNullOrEmpty(tEntity.IdentityCardNo) ? Md5Helper.Encrypt(Config.GetValue("pwdprex") + Config.GetValue("defaultpwd"), 32).ToLower() : Md5Helper.Encrypt(Config.GetValue("pwdprex") + tEntity.IdentityCardNo.Substring(tEntity.IdentityCardNo.Length - 6, 6), 32).ToLower(); + userbase.F_Password = (!string.IsNullOrEmpty(tEntity.IdentityCardNo) && tEntity.IdentityCardNo.Length >= 6) ? Md5Helper.Encrypt(Config.GetValue("pwdprex") + tEntity.IdentityCardNo.Substring(tEntity.IdentityCardNo.Length - 6, 6), 32).ToLower() : Md5Helper.Encrypt(Config.GetValue("pwdprex") + Config.GetValue("pwdsuff"), 32).ToLower(); userbase.F_HeadIcon = string.IsNullOrEmpty(url) ? Config.GetValue("defaultheadimg") : url; userbase.F_Gender = tEntity.GenderNo.HasValue ? Convert.ToInt32(tEntity.GenderNo.Value) : 1; userbase.F_DeleteMark = 0;