コード例 #1
0
        public static V_xy_sp_userView GetUserViewFromCache(string tokenValue)
        {
            V_tm_pm_userinfo userInfo = _cached.Get(tokenValue) as V_tm_pm_userinfo;

            if (userInfo == null)
            {
                userInfo = new tm_pm_userinfoBLL().GetLoginInfo(tokenValue);
            }

            V_xy_sp_userView userView = (V_xy_sp_userView)_cached.Get(tokenValue + "V_xy_sp_userView");

            if (userView == null)
            {
                userView = new xy_sp_userspiritBLL().GetCurrentUserStatebyUserID(userInfo.USERID);
                cacheuserView(tokenValue + "V_xy_sp_userView", userView);
            }
            return(userView);
        }
コード例 #2
0
        //
        // GET: /Fight/
        public ActionResult Index()
        {
            HttpCookie cookie = Request.Cookies["Token"];

            if (cookie != null)
            {
                string tokenValue = cookie.Value;
                if (!string.IsNullOrEmpty(tokenValue))
                {
                    V_tm_pm_userinfo user = new tm_pm_userinfoBLL().GetLoginInfo(tokenValue);
                    V_xy_sp_userView up   = new xy_sp_userspiritBLL().GetCurrentUserStatebyUserID(user.USERID);
                    if (up != null)
                    {
                        up.CurrentToken = tokenValue;
                        return(View(up));
                    }
                }
            }
            return(Redirect("/GameLogin"));
        }
コード例 #3
0
        public ActionResult Index()
        {
            ViewBag.para      = "";
            ViewBag.LoginName = "admin";
            HttpCookie cookie = Request.Cookies["Token"];

            if (cookie != null)
            {
                string tokenValue = cookie.Value;
                if (!string.IsNullOrEmpty(tokenValue))
                {
                    V_tm_pm_userinfo user = new tm_pm_userinfoBLL().GetLoginInfo(tokenValue);
                    if (user != null)
                    {
                        return(View());
                    }
                }
            }
            return(Redirect("User/Login"));
        }