Example #1
0
        public IActionResult Login([FromBody] LoginModel model)
        {
            var result = LogonUtility.Logon(model);

            return(Json(result, new JsonSerializerSettings
            {
                ContractResolver = new DefaultContractResolver()
            }));
        }
Example #2
0
        ///// <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));
        }
Example #3
0
        /// <summary>
        /// 注销
        /// </summary>
        /// <returns>ActionResult</returns>
        public ActionResult Logoff()
        {
            LogonUtility.Logoff();
            var result = new Result {
                IsSucceed = true
            };

            return(new MyJsonResult {
                Data = result
            });
        }
Example #4
0
        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);
            }
        }
Example #5
0
        //自动登录
        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();
                }
            }
        }
Example #6
0
        /// <summary>
        /// 获取验证码方法
        /// </summary>
        /// <returns>验证码</returns>
        public IActionResult GetValidateCode()
        {
            var code = LogonUtility.GenerateValidateCode();

            return(File(code, @"image/jpeg"));
        }
Example #7
0
 /// <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));
        }
Example #9
0
 protected void exit_ServerClick(object sender, EventArgs e)
 {
     LogonUtility.Logoff();
     Response.Redirect("/Agency.htm?target=" + System.Web.HttpUtility.UrlEncode("/Logon.aspx"), true);
 }