Browse Source

【修改】用户管理-重置密码,教师/学生生成账号,密码规则改为前缀+身份证后6位;

西昌分支
dyy 6 months ago
parent
commit
be0ad525c0
5 changed files with 31 additions and 11 deletions
  1. +6
    -5
      Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserBLL.cs
  2. +22
    -4
      Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserService.cs
  3. +1
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config
  4. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/EmpInfo/EmpInfoService.cs
  5. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicService.cs

+ 6
- 5
Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserBLL.cs View File

@@ -955,7 +955,7 @@ namespace Learun.Application.Organization
{
cache.Remove(cacheKeyId + item, CacheId.user);
}
string password = Md5Helper.Encrypt(ConfigurationManager.AppSettings["defaultpwd"], 32).ToLower();
string password = Md5Helper.Encrypt(ConfigurationManager.AppSettings["pwdprex"] + ConfigurationManager.AppSettings["defaultpwd"], 32).ToLower();
userService.RevisePasswordBatch(keyValue, password);
}
catch (Exception ex)
@@ -1212,7 +1212,8 @@ namespace Learun.Application.Organization
LoginOk = false
};
return userEntity;
}else if (userEntity.F_Description != "学生")
}
else if (userEntity.F_Description != "学生")
{
userEntity = new UserEntity()
{
@@ -1221,9 +1222,9 @@ namespace Learun.Application.Organization
};
return userEntity;
}
else
else
{
}

userEntity.LoginOk = false;
@@ -1260,7 +1261,7 @@ namespace Learun.Application.Organization
}
}
}
/// <summary>
/// 获取用户头像
/// </summary>


+ 22
- 4
Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserService.cs View File

@@ -2,6 +2,7 @@
using Learun.Util;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Runtime.CompilerServices;
@@ -543,16 +544,33 @@ namespace Learun.Application.Organization
foreach (var item in keyValue.Split(','))
{
UserEntity userEntity = new UserEntity();
userEntity.Modify(item);
userEntity.F_Secretkey = Md5Helper.Encrypt(CommonHelper.CreateNo(), 16).ToLower();
userEntity.F_Password = Md5Helper.Encrypt(DESEncrypt.Encrypt(password, userEntity.F_Secretkey).ToLower(), 32).ToLower();
db.Update(userEntity);
UserEntity userModel = this.BaseRepository().FindEntity<UserEntity>(x => x.F_UserId == item);
if (userModel != null)
{
userEntity.Modify(userModel.F_UserId);
userEntity.F_Secretkey = Md5Helper.Encrypt(CommonHelper.CreateNo(), 16).ToLower();
if (!string.IsNullOrEmpty(userModel.F_IdentityCardNo))
{
//密码规则:前缀+身份证后6位
password = Md5Helper.Encrypt(ConfigurationManager.AppSettings["pwdprex"] + userModel.F_IdentityCardNo.Substring(userModel.F_IdentityCardNo.Length - 6, 6), 32).ToLower();
}
userEntity.F_Password = Md5Helper.Encrypt(DESEncrypt.Encrypt(password, userEntity.F_Secretkey).ToLower(), 32).ToLower();
db.Update(userEntity);
}
}
db.Commit();
}
catch (Exception ex)
{
db.Rollback();
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}
/// <summary>


+ 1
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config View File

@@ -100,6 +100,7 @@
<!-- ================== 默认密码 ================== -->
<add key="defaultpwd" value="123456" />
<add key="defaultpwdeight" value="abc123**" />
<add key="pwdprex" value="Xcmzyz@" />
<!-- ================== 统一身份认证公钥密钥 ================== -->
<add key="SSOPublicSecret" value="bjquanjiang" />
<add key="SSOUserSecret" value="123456789" />


+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/EmpInfo/EmpInfoService.cs View File

@@ -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 = Md5Helper.Encrypt(Config.GetValue("defaultpwd"), 32).ToLower();
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_HeadIcon = string.IsNullOrEmpty(url) ? Config.GetValue("defaultheadimg") : url;
userbase.F_Gender = tEntity.GenderNo.HasValue ? Convert.ToInt32(tEntity.GenderNo.Value) : 1;
userbase.F_DeleteMark = 0;


+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicService.cs View File

@@ -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 = Md5Helper.Encrypt(Config.GetValue("defaultpwd"), 32).ToLower();
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_HeadIcon = string.IsNullOrEmpty(url) ? Config.GetValue("defaultheadimg") : url;
userbase.F_Gender = tEntity.GenderNo.HasValue ? Convert.ToInt32(tEntity.GenderNo.Value) : 1;
userbase.F_DeleteMark = 0;


Loading…
Cancel
Save