Пример #1
0
        // POST: /Login/LogOff
        public ActionResult LogOff()
        {
            var loginer = FormsAuth.GetBaseLoginerData();

            FormsAuth.SignOut();
            return(Redirect("/"));
        }
Пример #2
0
        //首页
        public ActionResult admin(string timestamp)
        {
            if (!FormsAuth.IsAuthenticated)
            {
                return(RedirectToAction("Index", "Login"));
            }

            initLan();

            ViewBag.Token     = CreateToken();
            ViewBag.user_info = JTS.Utils.DESEncrypt.Encrypt("/sys/sysbase]user_info", EncryptKey);
            var loginer = FormsAuth.GetBaseLoginerData();

            ViewBag.Title    = System.Configuration.ConfigurationManager.AppSettings["title"].ToString();;
            ViewBag.UserId   = loginer.UserId;
            ViewBag.UserCode = loginer.UserCode;
            ViewBag.UserName = loginer.UserName;
            // ViewBag.navigation = "menubutton";
            ViewBag.navigation = "accordion";
            ViewBag.Settings   = new { gridrows = 20, navigation = "accordion" };
            if (CurrentUser.DepartmentCode.Length > 0)
            {
                ViewBag.LoginUser = "******" + loginer.UserCode + "]" + loginer.UserName + "-" + CurrentUser.DepartmentCode;
            }
            else
            {
                ViewBag.LoginUser = "******" + loginer.UserCode + "]" + loginer.UserName;
            }
            ViewBag.EasyuiVersion = JTS.Utils.ConfigUtil.GetConfigString("EasyuiVersion"); //easyui版本
            ViewBag.SystemVersion = JTS.Utils.ConfigUtil.GetConfigString("SystemVersion"); //系统版本
            CookiesUtil.WriteCookies("EasyuiTheme", 0, "");
            CookiesUtil.WriteCookies("EasyuiVersion", 0, JTS.Utils.ConfigUtil.GetConfigString("EasyuiVersion"));

            JObject data = new JObject();

            data["role_ids"]  = loginer.RoleIDs;
            data["slanguage"] = Session["slanguage"].ToString();
            DataSet dt = base.RunProcedureDataSet(data, "vdp_get_menu", "sys");

            EncryptKey = System.Configuration.ConfigurationManager.AppSettings["EncryptKey"].ToString();;

            foreach (DataRow r in dt.Tables[0].Rows)
            {
                r["menu_token"] = Server.UrlEncode(JTS.Utils.DESEncrypt.Encrypt(r["url"] + "]" + r["menu_code"], EncryptKey));
            }


            var model = new
            {
                //  userSettings = userSettings,
                UserId   = loginer.UserId,
                UserCode = loginer.UserCode,
                UserName = loginer.UserName //,
                                            //  UserMenus2 =Dtb2Json( dt.Tables[0])
            };

            ViewBag.UserMenus = Dtb2Json(dt.Tables[0]);
            return(View(model));
        }
Пример #3
0
        public ActionResult HomePage()
        {
            var loginer = FormsAuth.GetBaseLoginerData();

            ViewBag.Title    = "MangoGreen";
            ViewBag.UserId   = loginer.UserId;
            ViewBag.UserCode = loginer.UserCode;
            ViewBag.UserName = loginer.UserName;

            ViewBag.LoginUser = loginer.UserName;
            return(View());
        }
Пример #4
0
        // POST: /Login/LogOff
        public ActionResult LogOff()
        {
            var loginer = FormsAuth.GetBaseLoginerData();

            LogHelper.Write("退出系统!账号:" + loginer.UserCode + ",姓名:" + loginer.UserName);
            string userinfo = string.Format("用户姓名:{0},用户编号:{1},登录账号:{2},登录密码:{3}",
                                            loginer.UserName, loginer.UserId, loginer.UserCode, loginer.Password);

            Base_SysLogService.Instance.AddLogoutLog(userinfo, "", "");
            FormsAuth.SignOut();
            return(Redirect("~/Login"));
        }
Пример #5
0
        //首页
        public ActionResult Index(string timestamp)
        {
            if (!FormsAuth.IsAuthenticated)
            {
                return(RedirectToAction("Index", "Login"));
            }
            // 无限光年网络科技
            var loginer = FormsAuth.GetBaseLoginerData();

            ViewBag.Title     = "KM企业快速开发框架";
            ViewBag.UserId    = loginer.UserId;
            ViewBag.UserCode  = loginer.UserCode;
            ViewBag.UserName  = loginer.UserName;
            ViewBag.LoginUser = "******" + loginer.UserCode + "]" + loginer.UserName;
            var userSettings = Base_UserService.Instance.GetCurrentUserSettings();

            ViewBag.Settings      = userSettings;
            ViewBag.EasyuiTheme   = userSettings["theme"].ToString();
            ViewBag.EasyuiVersion = JTS.Utils.ConfigUtil.GetConfigString("EasyuiVersion");
            ViewBag.SystemVersion = JTS.Utils.ConfigUtil.GetConfigString("SystemVersion");
            CookiesUtil.WriteCookies("EasyuiTheme", 0, userSettings["theme"].ToString());
            CookiesUtil.WriteCookies("EasyuiVersion", 0, JTS.Utils.ConfigUtil.GetConfigString("EasyuiVersion"));
            var list = Base_MenuService.Instance.GetUserMenus(this.CurrentUser.UserId, this.CurrentUser.IsSuperAdmin == 1);
            //测试发送一条验证短信
            //Random rnd = new Random();
            //int num = rnd.Next(304001, 504001);
            //var result = KM.TaobaoApi.ApiManager.Instance.SendSMS(loginer.UserId.ToString(), num.ToString(), "13520075291,15301024100");
            //var smsStr = JsonConvert.SerializeObject(result);
            //LogHelper.Write("测试短信发送结果:" + smsStr);
            var model = new
            {
                userSettings = userSettings,
                UserId       = loginer.UserId,
                UserCode     = loginer.UserCode,
                UserName     = loginer.UserName,
                UserMenus    = list
            };


            return(View(model));
        }
Пример #6
0
        public ActionResult Index()
        {
            var loginer = FormsAuth.GetBaseLoginerData();

            ViewBag.Title    = "MangoGreen";
            ViewBag.UserId   = loginer.UserId;
            ViewBag.UserCode = loginer.UserCode;
            ViewBag.UserName = loginer.UserName;

            ViewBag.LoginUser = loginer.UserName;


            //var server = GetService<ISys_MenuService>();
            // var userSettings = Base_UserService.Instance.GetCurrentUserSettings();
            var userSettings = new Dictionary <string, string>();

            userSettings.Add("navigation", "menubutton1");
            userSettings.Add("theme", "bootstrap");
            ViewBag.Settings      = userSettings;
            ViewBag.EasyuiTheme   = userSettings["theme"].ToString();
            ViewBag.EasyuiVersion = ConfigUtil.GetConfigString("EasyuiVersion"); //easyui版本
            ViewBag.SystemVersion = ConfigUtil.GetConfigString("SystemVersion"); //系统版本
            CookiesUtil.WriteCookies("EasyuiTheme", 0, userSettings["theme"].ToString());
            CookiesUtil.WriteCookies("EasyuiVersion", 0, ConfigUtil.GetConfigString("EasyuiVersion"));
            var server = GetService <ISys_MenuService>();
            var list   = server.GetUserMenus(loginer);
            var model  = new
            {
                userSettings = userSettings,
                UserId       = loginer.UserId,
                UserCode     = loginer.UserCode,
                UserName     = loginer.UserName,
                UserMenus    = list
            };

            return(View(model));
        }