合并最新

This commit is contained in:
2022-12-20 09:32:32 +08:00
parent 844e9f1488
commit 1abdaa9476
654 changed files with 73563 additions and 9746 deletions
+32
View File
@@ -71,6 +71,38 @@ namespace BLL
page.Response.Cookies["UserInfo"].Expires = DateTime.Now.AddDays(-1);
}
return true;
}
else
{
return false;
}
}
/// <summary>
/// 用户登录成功方法
/// </summary>
/// <param name="loginname">登录成功名</param>
/// <param name="password">未加密密码</param>
/// <param name="rememberMe">记住我开关</param>
/// <param name="page">调用页面</param>
/// <returns>是否登录成功</returns>
public static bool UserLogOnByAccount(string account, System.Web.UI.Page page)
{
var x = (from y in Funs.DB.Sys_User
where y.Account == account && y.IsPost == true
select y);
if (x.Any())
{
string accValue = HttpUtility.UrlEncode(account);
FormsAuthentication.SetAuthCookie(accValue, false);
page.Session[SessionName.CurrUser] = x.First();
// 当选择不保存用户名时,Cookies过期时间设置为昨天.
page.Response.Cookies["UserInfo"].Expires = DateTime.Now.AddDays(-1);
return true;
}
else