YongHu_UI/login.aspx.cs
(完整代码) 1KBusing Clothes.BLL;
using Clothes.Comment;
using Clothes.IBLL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using YongHu_UI.Model;
namespace YongHu_UI
{
public partial class login : System.Web.UI.Page
{
IAccountManager AccountManager = new AccountManager();
CLLoginIBLL cLLogin = new CLLoginBLL();
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnLogin_Click(object sender, EventArgs e)
{
if (Page.IsValid)
{
var result = AccountManager.LoginByUserName(txtUserName.Text, txtPassword.Text);
var deng = cLLogin.SelectSourceBLL(txtUserName.Text, txtPassword.Text);
if (deng != null) {
int guan = deng.Manager;
//登录验证
CLUserBLL userManager = new CLUserBLL();
if (result.StatusCode == StatusCode.Succeed)
{
// 缓存用户资料
var user = result.ReadResult();
IdentityManager.SaveUser(deng);
// 脚本跳转
if (guan == 0)
{
Response.Redirect("index.aspx");
}
else
{
Response.Redirect("table.aspx");
}
}
else
{
ClientScript.RegisterStartupScript(GetType(), "loginerror", $"alert('{result.Message}')", true);
}
}
ClientScript.RegisterStartupScript(GetType(), "loginerror", "alert('没有该用户')", true);
}
}
}
}
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。