Exemplo n.º 1
0
        protected override void OnInit(EventArgs e)
        {
            //屏蔽用户,自动认证
            g_IsUnAuth = WebTools.GetRequestVal("from", string.Empty) == "unauth";

            //自动登录
            g_IsAutoLogin = WebTools.GetRequestVal("from1", string.Empty) == "autologin";
            if (g_IsAutoLogin)
            {
                RightSys    rs     = new RightSys();
                ReturnValue retVal = rs.Login("admin", "admin", 2628000, DateTime.Now);
            }

            ReadyPageState();

            if (g_IsUnAuth == false)
            {
                ReadyUCInfo();
            }

            ReadySysCfg();
            if (g_IsUnAuth == false)
            {
                ReadyUserCfg();
            }
            //ReadyURInfo();
            baseSys.GetCurrMng();

            if (!g_IsAjax)
            {
                if (WebTools.GetCookieVal("testSkin", string.Empty) != string.Empty)                   // 用于测试的皮肤
                {
                    _Skin = WebTools.GetCookieVal("testSkin", string.Empty);
                }
                else if (WebTools.GetCookieVal("tempSkin", string.Empty) != string.Empty)              // 用于修改数据库后即时修改页面
                {
                    _Skin = WebTools.GetCookieVal("tempSkin", string.Empty);
                }
                else if (g_UserCfg != null && g_UserCfg.ContainsKey("skin"))    // 用户自定义的皮肤
                {
                    _UserCfg.TryGetValue("skin", out _Skin);
                }
                else if (g_SysCfg != null && g_SysCfg.ContainsKey("skin"))      // 系统默认的皮肤
                {
                    _SysCfg.TryGetValue("skin", out _Skin);
                }
            }

            Random rnd    = new Random();
            Int32  rndNum = rnd.Next(100000000, 999999999);     //得1000000~9999999的随机数

            Session["SeqNo"] = rndNum;

            g_HeadHtml = "<meta http-equiv='X-UA-Compatible' content='IE=EmulateIE7' />";
        }