示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            site_supplier = new Site_Supplier();

            CookieTool.DeleteCookie("User");
            Response.Redirect(site_supplier.AdminPath + "/login.aspx?url=" + HttpUtility.UrlEncode(RequestTool.GetUrlReferrerNonDomain()) + "");
        }
示例#2
0
 /// <summary>
 /// 验证微信是否已经授权-绑定账号
 /// </summary>
 public void wechatbind()
 {
     if (CurrentUser.bind_weixin_id != "")
     {
         CookieTool.DeleteCookie("qrcodeid");
         Response.Write("{\"msg\":\"OK\"}");
         return;
     }
     Response.Write("{\"msg\":\"NO\"}");
 }
示例#3
0
 /// <summary>
 /// 管理员退出登录
 /// </summary>
 /// <returns></returns>
 public void LoginOut()
 {
     try
     {
         Log.Add("退出系统", "Login", EX_Admin.CurrentAdmin().id.ToString(), EX_Admin.CurrentAdmin());
         CookieTool.DeleteCookie("Master");
         Response.Write("OK");
     }
     catch
     {
     }
 }
示例#4
0
 /// <summary>
 /// 管理员退出登录
 /// </summary>
 /// <returns></returns>
 public void LoginOut()
 {
     try
     {
         Log.Add("退出系统", "Login");
         CookieTool.DeleteCookie("User");
         Response.Write("OK");
     }
     catch
     {
     }
 }
示例#5
0
        /// <summary>
        /// 退出登录
        /// </summary>
        public void User_LoginOut()
        {
            CookieTool.DeleteCookie("User");
            string url = URL("P_Index", "");

            if (IsWechat())
            {
                if (url.Contains("&weixinlogin=1"))
                {
                    url = url.Replace("&weixinlogin=1", "");
                }
                else
                {
                    url = url.Replace("?weixinlogin=1", "");
                }
            }
            Response.Write("{\"msg\":\"OK\",\"mes\":\"" + Tag("已退出登录") + "\",\"url\":\"" + url + "\"}");
        }
示例#6
0
        /// <summary>
        /// 验证微信是否已经授权-登陆账号
        /// </summary>
        public void wechatlogin()
        {
            string cid = CookieTool.GetCookieString("qrcodeid");
            int    id  = 0;

            if (cid != "")
            {
                int.TryParse(cid, out id);
                Lebi_weixin_qrcode model = B_Lebi_weixin_qrcode.GetModel(id);
                if (model != null)
                {
                    if (model.User_id > 0)
                    {
                        //CookieTool.SetCookieString("qrcodeid", "0", -1);
                        CookieTool.DeleteCookie("qrcodeid");
                        Lebi_User user = B_Lebi_User.GetModel(model.User_id);
                        EX_User.LoginOK(user);
                        Response.Write("{\"msg\":\"OK\"}");
                        return;
                    }
                }
            }
            Response.Write("{\"msg\":\"NO\"}");
        }
示例#7
0
        /// <summary>
        /// 用户登录
        /// </summary>
        public void User_Login()
        {
            string verifycode = RequestTool.RequestString("verifycode");

            string UserName = RequestTool.RequestSafeString("UserName");
            string PWD      = RequestTool.RequestSafeString("Password");
            string token    = RequestTool.RequestString("token");
            string url      = "";

            if (SYS.Verifycode_UserLogin == "1")
            {
                string loginerror = "false";
                try
                {
                    loginerror = (string)HttpContext.Current.Session["loginerror"];
                }
                catch
                {
                    loginerror = "false";
                }
                if (loginerror == "true")
                {
                    if (CurrentCheckCode != verifycode && CurrentCheckCode != "")
                    {
                        Response.Write("{\"msg\":\"" + Tag("验证码错误") + "\"}");
                        return;
                    }
                }
            }
            if (EX_User.UserLogin(UserName, PWD))
            {
                CurrentUser = EX_User.CurrentUser();
                if (ShopCache.GetBaseConfig().IsOpenUserEnd == "1")
                {
                    if (CurrentUser.Time_End < System.DateTime.Now)
                    {
                        Response.Write("{\"msg\":\"" + Tag("账号已过期") + "\"}");
                        CookieTool.DeleteCookie("User");
                        return;
                    }
                }
                url = RequestTool.RequestString("url").Replace("<", "").Replace(">", "");
                if (EX_User.MD5(SYS.InstallCode + url) != token)
                {
                    url = URL("P_Index", "");
                }
                if (url.ToLower().IndexOf("http") > -1 || url.ToLower().IndexOf(URL("P_Register", "").ToLower()) > -1 || url.ToLower().IndexOf(URL("P_Login", "").ToLower()) > -1 || url == "")
                {
                    url = URL("P_Index", "");
                }
                if (SYS.Verifycode_UserLogin == "1")
                {
                    HttpContext.Current.Session["loginerror"] = "false";
                }
                Response.Write("{\"msg\":\"OK\",\"url\":\"" + url + "\"}");
            }
            else
            {
                if (SYS.Verifycode_UserLogin == "1")
                {
                    HttpContext.Current.Session["loginerror"] = "true";
                }
                Response.Write("{\"msg\":\"" + Tag("用户名或密码错误") + "\"}");
            }
        }