Beispiel #1
0
        private void GetUserInfo()
        {
            HttpCookie cookie = Request.Cookies["EccmUserinfo"];

            if (cookie != null)
            {
                //解密Cookie
                HttpCookie decodeCookie = HttpSecureCookie.Decode(cookie);

                //显示用户登录名
                string loginname = decodeCookie.Values["loginname"];
                //lbl_user.Text = loginname;
                string UserID = decodeCookie.Values["userid"].ToString();
                //权限菜单
                if (loginname == "admin")
                {
                    menus = menu_bll.GetMenuList(string.Empty);
                }
                else
                {
                    menus = menu_bll.GetRoleMenuByUserId(UserID);
                }
            }
            else
            {
                Response.Redirect("/login.html");
            }
        }