|
|
@@ -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> |
|
|
|