/// <summary>
        /// 验证是否有用户id参数
        /// </summary>
        /// <returns></returns>
        protected virtual bool ValidationLoginUserId()
        {
            var sings = FormsPrincipal <CookUserInfo> .TryParsePrincipal(Request);

            if (null == sings)
            {
                return(false);
            }
            this.mCookUserInfo = sings.UserData;
            if (null != this.mCookUserInfo)
            {
                this.mloginUserId = this.mCookUserInfo.Id;
                var sessionitem = mSysUserSessionService.GetUserId(this.mCookUserInfo.Id);

                if (sessionitem == null || sessionitem.SessionId != mCookUserInfo.Sex)
                {
                    //清除cookie ,禁止登录,
                    FormsPrincipal <CookUserInfo> .SignOut();

                    AppGlobal.RenderResult(ApiCode.ExitLogin);
                    return(false);
                }
            }
            else
            {
                int.TryParse(this.Request.Params["loginUserId"], out mloginUserId);
            }

            return(mloginUserId > 0);
        }
Exemple #2
0
        protected void Session_End(object sender, EventArgs e)
        {
            Hashtable hOnline = (Hashtable)Application["Online"];

            if (hOnline == null)
            {
                return;
            }
            if (hOnline[Session.SessionID] != null)
            {
                hOnline.Remove(Session.SessionID);
                Application.Lock();
                Application["Online"] = hOnline;
                Application.UnLock();
                //移除cookie
                FormsPrincipal <CookUserInfo> .SignOut();
            }
        }
Exemple #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(Request.Params["type"]))
            {
                //注销
                FormsPrincipal <CookUserInfo> .SignOut();

                Response.Redirect("/Login.aspx");
            }

            if (!IsPostBack)
            {
                if (Request["action"] == null)
                {
                    this.LoadMenu();
                }
            }

            //获取提现,充值人数
            if (Request["action"] != null)
            {
                GetBusinessCount();
            }
        }
        /// <summary>
        /// 注销登陆
        /// </summary>
        private void Logout()
        {
            FormsPrincipal <CookUserInfo> .SignOut();

            AppGlobal.RenderResult(ApiCode.Success);
        }