20230806修改账号的密码安全策略

This commit is contained in:
2023-08-06 22:38:05 +08:00
parent f13d77c520
commit 2804d7c4df
15 changed files with 189 additions and 174 deletions
+18
View File
@@ -2,6 +2,7 @@
{
using BLL;
using System;
using System.Linq;
using System.Web.Services;
public partial class Login : PageBase
@@ -77,6 +78,23 @@
Session.Remove("ProjectId");
PHTUrl = Request.Params["PHTUrl"];
ProjectId = Request.Params["ProjectId"];
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var getPass = db.Person_Persons.FirstOrDefault(x => x.RawPassword != null);
if (getPass == null)
{
var getUsers = from x in db.Person_Persons
where x.PersonId != Const.hfnbdId && x.Account.Length > 0
select x;
foreach (var item in getUsers)
{
string password = Funs.getInitialPassword(item.UnitId, item.IdentityCard);
item.RawPassword = password;
item.Password = Funs.EncryptionPassword(password);
db.SubmitChanges();
}
}
}
}
}
#endregion