Example #1
0
        /// <summary>
        /// 用户退出登录
        /// </summary>
        /// <returns></returns>
        public ActionResult Logout()
        {
            //TODO:退出逻辑
            CurrentContext.ClearUser();
            string channelId = RouteChannelId;

            return(Redirect(("/").GetChannelRouteUrl(channelId)));
        }
Example #2
0
        private bool IsLogin()
        {
            if (currentUser != null && !string.IsNullOrEmpty(Host) && string.Compare(currentUser.LoginedId, Host, true) != 0)
            {
                DataContext.ErrorLog("Authentication", "IsLogin", "", "IsLogin:Host=" + Host + "&Id=" + currentUser.LoginedId);

                currentUser = null;
                CurrentContext.ClearUser();
            }

            return(currentUser != null && !string.IsNullOrEmpty(currentUser.UserName));
            //&& loginedUserInfo.UserId > 0;
        }
Example #3
0
        /// <summary>
        /// 判断是否已登录
        /// true:已登录
        /// false:未登录
        /// </summary>
        /// <returns></returns>
        protected bool IsLogin()
        {
            if (currentUser != null && !string.IsNullOrEmpty(Host) && string.Compare(currentUser.LoginedId, Host, true) != 0)
            {
                Log("IsLogin:Host=" + Host + "&Id=" + currentUser.LoginedId);

                currentUser = null;
                CurrentContext.ClearUser();
            }

            return(currentUser != null && !string.IsNullOrEmpty(currentUser.UserName));
            //&& loginedUserInfo.UserId > 0;
        }
 public ActionResult Logout()
 {
     CurrentContext.ClearUser();
     Session.RemoveAll();
     return(Redirect("/admin/login"));
 }
 protected void Application_Stop()
 {
     CurrentContext.ClearUser();
 }