This commit is contained in:
高飞 2025-10-27 15:42:44 +08:00
parent 751270c1c6
commit 64cf9e51b6
5 changed files with 120 additions and 34 deletions

View File

@ -0,0 +1,3 @@
alter table Sys_User add LockTime datetime null
alter table Sys_User add ErrorTimes int null
GO

View File

@ -357,6 +357,8 @@ namespace BLL
newUser.AllowLoginSystem = user.AllowLoginSystem; newUser.AllowLoginSystem = user.AllowLoginSystem;
newUser.Phone = user.Phone; newUser.Phone = user.Phone;
newUser.SignatureUrl = user.SignatureUrl; newUser.SignatureUrl = user.SignatureUrl;
newUser.LockTime = user.LockTime;
newUser.ErrorTimes = user.ErrorTimes;
db.SubmitChanges(); db.SubmitChanges();
} }

View File

@ -7,6 +7,7 @@ using System.IO;
using System.Text; using System.Text;
using System.Security.Cryptography; using System.Security.Cryptography;
using CodeName.APPa; using CodeName.APPa;
using System.Linq;
namespace FineUIPro.Web namespace FineUIPro.Web
{ {
@ -53,38 +54,70 @@ namespace FineUIPro.Web
string password = this.tbxPassword.Text; string password = this.tbxPassword.Text;
bool rememberMe = this.savemessgae.Checked; bool rememberMe = this.savemessgae.Checked;
bool isLogin = false; bool isLogin = false;
///登陆信息是否正确 var sysUser = Funs.DB.Sys_User.FirstOrDefault(x => x.Account == userName && x.IsPost == true);
if (BLL.Sys_UserService.UserLogOn(userName, password, rememberMe, this.Page)) if (sysUser != null)
{ {
isLogin = true; if (sysUser.LockTime.HasValue && sysUser.LockTime.Value > DateTime.Now)
} {
//else Alert.Show("账号锁定30分钟", MessageBoxIcon.Error);
//{ return;
// ////检查域名是否存在 }
// var admoain = BLL.ADomainService.IsConnected(Funs.ADomainUrl, userName, BLL.CommonService.Base64Code(password)); else
// if (admoain != null) {
// { if (sysUser.Password.ToUpper() != Sys_UserService.EncryptionPassword(password).ToUpper())
// if (BLL.Sys_UserService.ADUserLogOn(userName, rememberMe, this.Page)) {
// { if (sysUser.LockTime.HasValue && sysUser.LockTime.Value < DateTime.Now)
// isLogin = true; {
// } sysUser.ErrorTimes = null;
// else sysUser.LockTime = null;
// { Sys_UserService.UpdateUser(sysUser);
// Alert.Show("当前用户不在岗", MessageBoxIcon.Warning); }
// return; if (sysUser.ErrorTimes.HasValue && sysUser.ErrorTimes.Value >= 4)
// } {
// } sysUser.ErrorTimes = sysUser.ErrorTimes.Value + 1;
//} sysUser.LockTime = DateTime.Now.AddMinutes(30);
if (isLogin) Sys_UserService.UpdateUser(sysUser);
{ Alert.Show("账号锁定30分钟", MessageBoxIcon.Error);
BLL.Sys_LogService.AddLog(Const.System_1, this.CurrUser.LoginProjectId, this.CurrUser.UserId, "登陆成功!"); return;
Response.Redirect("~/default.aspx"); }
else if (sysUser.ErrorTimes.HasValue)
{
sysUser.ErrorTimes = sysUser.ErrorTimes.Value + 1;
Sys_UserService.UpdateUser(sysUser);
// error = "密码错误" + sysUser.ErrorTimes + "次超过5次将锁定10分钟";
Alert.Show("用户名或密码错误超过5次将锁定30分钟请重新输入", MessageBoxIcon.Error);
return;
}
else
{
sysUser.ErrorTimes = 1;
Sys_UserService.UpdateUser(sysUser);
Alert.Show("用户名或密码错误超过5次将锁定30分钟请重新输入", MessageBoxIcon.Error);
return;
}
}
///登陆信息是否正确
if (BLL.Sys_UserService.UserLogOn(userName, password, rememberMe, this.Page))
{
isLogin = true;
}
if (isLogin)
{
BLL.Sys_LogService.AddLog(Const.System_1, this.CurrUser.LoginProjectId, this.CurrUser.UserId, "登陆成功!");
Response.Redirect("~/default.aspx");
}
else
{
Alert.Show("账户与密码不匹配!", MessageBoxIcon.Error);
return;
}
}
} }
else else
{ {
Alert.Show("账户与密码不匹配", MessageBoxIcon.Error); Alert.Show("用户名或密码错误,请重新输入!", MessageBoxIcon.Error);
return; return;
} }
} }
/// <summary> /// <summary>

View File

@ -11,7 +11,7 @@
<FineUIPro DebugMode="false" Theme="Cupertino"/> <FineUIPro DebugMode="false" Theme="Cupertino"/>
<appSettings> <appSettings>
<!--连接字符串--> <!--连接字符串-->
<add key="ConnectionString" value="Server=.\SQL2022;Database=HJGLDB_DS;Integrated Security=False;User ID=sa;Password=1111;MultipleActiveResultSets=true;Max Pool Size = 1000;Connect Timeout=1200"/> <add key="ConnectionString" value="Server=.\MSSQLSERVER01;Database=HJGLDB_DS;Integrated Security=False;User ID=sa;Password=1111;MultipleActiveResultSets=true;Max Pool Size = 1000;Connect Timeout=1200"/>
<!--系统名称--> <!--系统名称-->
<add key="SystemName" value="诺必达焊接管理系统"/> <add key="SystemName" value="诺必达焊接管理系统"/>
<add key="ChartImageHandler" value="storage=file;timeout=20;url=~/Images/;"/> <add key="ChartImageHandler" value="storage=file;timeout=20;url=~/Images/;"/>

View File

@ -61914,7 +61914,7 @@ namespace Model
} }
} }
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WED_Code", DbType="NVarChar(41) NOT NULL", CanBeNull=false)] [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WED_Code", DbType="VarChar(41)")]
public string WED_Code public string WED_Code
{ {
get get
@ -62010,7 +62010,7 @@ namespace Model
} }
} }
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RTReport", DbType="NVarChar(50)")] [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RTReport", DbType="NVarChar(100)")]
public string RTReport public string RTReport
{ {
get get
@ -62042,7 +62042,7 @@ namespace Model
} }
} }
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UTReport", DbType="NVarChar(50)")] [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UTReport", DbType="NVarChar(100)")]
public string UTReport public string UTReport
{ {
get get
@ -62074,7 +62074,7 @@ namespace Model
} }
} }
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MTReport", DbType="NVarChar(50)")] [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MTReport", DbType="NVarChar(100)")]
public string MTReport public string MTReport
{ {
get get
@ -62106,7 +62106,7 @@ namespace Model
} }
} }
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PTReport", DbType="NVarChar(50)")] [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PTReport", DbType="NVarChar(100)")]
public string PTReport public string PTReport
{ {
get get
@ -62411,7 +62411,7 @@ namespace Model
} }
} }
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WED_Code", DbType="NVarChar(41) NOT NULL", CanBeNull=false)] [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WED_Code", DbType="VarChar(41)")]
public string WED_Code public string WED_Code
{ {
get get
@ -100541,6 +100541,10 @@ namespace Model
private string _IdCard; private string _IdCard;
private System.Nullable<System.DateTime> _LockTime;
private System.Nullable<int> _ErrorTimes;
private EntitySet<Base_Project> _Base_Project; private EntitySet<Base_Project> _Base_Project;
private EntitySet<Common_NoticeSign> _Common_NoticeSign; private EntitySet<Common_NoticeSign> _Common_NoticeSign;
@ -100629,6 +100633,10 @@ namespace Model
partial void OnSignatureUrlChanged(); partial void OnSignatureUrlChanged();
partial void OnIdCardChanging(string value); partial void OnIdCardChanging(string value);
partial void OnIdCardChanged(); partial void OnIdCardChanged();
partial void OnLockTimeChanging(System.Nullable<System.DateTime> value);
partial void OnLockTimeChanged();
partial void OnErrorTimesChanging(System.Nullable<int> value);
partial void OnErrorTimesChanged();
#endregion #endregion
public Sys_User() public Sys_User()
@ -101051,6 +101059,46 @@ namespace Model
} }
} }
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_LockTime", DbType="DateTime")]
public System.Nullable<System.DateTime> LockTime
{
get
{
return this._LockTime;
}
set
{
if ((this._LockTime != value))
{
this.OnLockTimeChanging(value);
this.SendPropertyChanging();
this._LockTime = value;
this.SendPropertyChanged("LockTime");
this.OnLockTimeChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ErrorTimes", DbType="Int")]
public System.Nullable<int> ErrorTimes
{
get
{
return this._ErrorTimes;
}
set
{
if ((this._ErrorTimes != value))
{
this.OnErrorTimesChanging(value);
this.SendPropertyChanging();
this._ErrorTimes = value;
this.SendPropertyChanged("ErrorTimes");
this.OnErrorTimesChanged();
}
}
}
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Base_Project_Sys_User", Storage="_Base_Project", ThisKey="UserId", OtherKey="CreateManId", DeleteRule="NO ACTION")] [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Base_Project_Sys_User", Storage="_Base_Project", ThisKey="UserId", OtherKey="CreateManId", DeleteRule="NO ACTION")]
public EntitySet<Base_Project> Base_Project public EntitySet<Base_Project> Base_Project
{ {