private void LoadInfo() { InitUserRole(); if (id > 0) { //用户为系统管理员则不允许修改,修改密码从修改密码地址进入修改 if (id == 1) { ShowMassage.Html("不允许修改该用户资"); Response.End(); } UserModel model = new UserBLL().GetModelById(id); if (model != null) { txtUName.Text = HttpUtility.HtmlDecode(model.Name); txtVerityName.Text = HttpUtility.HtmlDecode(model.RealName); txtEmail.Text = HttpUtility.HtmlDecode(model.Email); txtMobile.Text = HttpUtility.HtmlDecode(model.Mobile); txtTel.Text = HttpUtility.HtmlDecode(model.Tel); chkDisabled.Checked = model.Disabled; txtUName.Enabled = false; txtPwd.Required = false; txtPwd.ShowRedStar = false; } else { Alert.ShowInParent("读取数据失败!", String.Empty, ActiveWindow.GetHideReference()); } } else { Alert.ShowInParent("参数错误!", String.Empty, ActiveWindow.GetHideReference()); } }
void Start() { manim = crateTip_panel.transform.GetComponent<Animator>(); if(_instance==null) { _instance = this; } }
private void LoadLogin() { string userName = HttpUtility.HtmlEncode(RequestHelper.GetRequestString("username")); string password = HttpUtility.HtmlEncode(RequestHelper.GetRequestString("userpwd")); //请填写完整 if (userName.Length == 0 || password.Length == 0) { Response.Write(ShowMassage.Html("请填写完整", "default.aspx")); } else { UserModel model = bll.GetModelByUserName(userName); if (model == null) { logBLL.AddLog("登录", Request.RawUrl, Request.HttpMethod, "登录系统;结果:失败(用户名不存在)", 0, userName); Response.Write(ShowMassage.Html("用户名不存在", "default.aspx")); } else { if (model.Pwd == MD5Encrypt.GetPass(password, model.Encrypt)) { if (model.Disabled == false) { bll.UpdateByLogin(model.Id, RequestHelper.GetIP()); //登录成功,保存至cookie RABCCookie cookie = new RABCCookie(); DateTime time = DateTime.Now; cookie.AddUserNameCookie(model.Name, time, 0); cookie.AddPurviewCodeCookie(bll.GetPurviewCodesByUserId(model.Id), time, 0); logBLL.AddLog("登录", Request.RawUrl, Request.HttpMethod, "登录系统;结果:成功", model.Id, model.Name); //跳转至首页 Response.Write(ShowMassage.Html("登录成功", "index.aspx")); } else { logBLL.AddLog("登录", Request.RawUrl, Request.HttpMethod, "登录系统;结果:失败(该用户状态为禁止登录)", model.Id, model.Name); Response.Write(ShowMassage.Html("该用户已经被禁止登录", "default.aspx")); } } else { logBLL.AddLog("登录", Request.RawUrl, Request.HttpMethod, "登录系统;结果:失败(密码错误)", model.Id, model.Name); Response.Write(ShowMassage.Html("密码错误", "default.aspx")); } } } Response.End(); }
protected void Page_Load(object sender, EventArgs e) { string action = RequestHelper.GetRequestString("action"); if (action == "logout") { if (cookie.UserName.Length > 0) { cookie.ClearCookie(); } AddLog("退出", "用户安全退出系统"); Response.Write(ShowMassage.Html("安全退出成功", "default.aspx")); Response.End(); } else { userName = currentUser.Name; ip = RequestHelper.GetIP(); LoadFirstMenu(); } }
private void LoadData() { // 如果用户已经登录,则重定向到管理首页 RABCCookie cookie = new RABCCookie(); if (cookie.UserName.Length > 0) { UserModel model = bll.GetModelByUserName(cookie.UserName); if (model != null && model.Disabled == false) { bll.UpdateByLogin(model.Id, RequestHelper.GetIP()); //登录成功,保存至cookie DateTime time = DateTime.Now; cookie.AddUserNameCookie(model.Name, time, 0); cookie.AddPurviewCodeCookie(bll.GetPurviewCodesByUserId(model.Id), time, 0); logBLL.AddLog("登录", Request.RawUrl, Request.HttpMethod, "Session登录系统;结果:成功", model.Id, model.Name); //跳转至首页 Response.Write(ShowMassage.Html("登录成功", "index.aspx")); Response.End(); } } }