public IActionResult Login([FromBody] LoginModel model) { var result = LogonUtility.Logon(model); return(Json(result, new JsonSerializerSettings { ContractResolver = new DefaultContractResolver() })); }
///// <summary> ///// QueryMenu ///// </summary> ///// <returns>ActionResult</returns> //public IActionResult QueryTMenu() //{ // return this.PartialView(); //} /// <summary> /// 注销 /// </summary> /// <returns>ActionResult</returns> public ActionResult Logoff() { LogonUtility.Logoff(); var result = new Result { IsSucceed = true }; return(Json(result)); }
/// <summary> /// 注销 /// </summary> /// <returns>ActionResult</returns> public ActionResult Logoff() { LogonUtility.Logoff(); var result = new Result { IsSucceed = true }; return(new MyJsonResult { Data = result }); }
protected void btnLogon_Click(object sender, EventArgs e) { string message; if (LogonUtility.Logon(this.txtUserName.Text.Trim(), this.txtPassword.Text, this.txtCode.Text.Trim(), chkJizhu.Checked, out message)) { userLogonSuccess(); } else { ClientScript.RegisterClientScriptBlock(this.GetType(), "tip", "msg = '" + message.Replace("\n", string.Empty).Replace("\r", string.Empty) + "'", true); } }
//自动登录 private void AutoLogin() { HttpCookie c*k = Request.Cookies["userKey"]; //获取上次登录保存的cookice if (c*k != null && c*k.Values["user"] != null) { string user = c*k.Values["user"]; string message; if (user.Split('|').Length < 2) { return; } if (LogonUtility.Logon(LogonUtility.Decode(GetDecode(user.Split('|')[0])), LogonUtility.Decode(GetDecode(user.Split('|')[1])), false, out message)) { userLogonSuccess(); } } }
/// <summary> /// 获取验证码方法 /// </summary> /// <returns>验证码</returns> public IActionResult GetValidateCode() { var code = LogonUtility.GenerateValidateCode(); return(File(code, @"image/jpeg")); }
/// <summary> /// 加载 /// </summary> protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { var userName = Request.QueryString["userName"]; var orderId = Request.QueryString["orderId"]; var time = Request.QueryString["time"]; var sign = Request.QueryString["key"]; var type = Request.QueryString["type"]; string message; if (validateArgs(userName, orderId, type, time, sign, out message) && LogonUtility.Logon(userName, out message)) { var urlParameter = HttpUtility.UrlEncode(string.Format("/OrderModule/Purchase/OrderPay.aspx?id={0}&type={1}", orderId, type)); Response.Redirect(string.Format("/Index.aspx?redirectUrl={0}", urlParameter)); } else { Response.Write(message); } } }
public ActionResult Login(string userName, string password, string validateCode) { var result = LogonUtility.Logon(userName, password, validateCode); return(Json(result)); }
protected void exit_ServerClick(object sender, EventArgs e) { LogonUtility.Logoff(); Response.Redirect("/Agency.htm?target=" + System.Web.HttpUtility.UrlEncode("/Logon.aspx"), true); }