public ActionResult Login(string ReturnUrl = "", int Status = 0, string name = "", int BindAccountType = 0) { if (Session["ClientManager"] != null) { return(Redirect("/Default/Index")); } ViewBag.Status = Status; ViewBag.BindAccountType = BindAccountType; ViewBag.ReturnUrl = ReturnUrl.Replace("&", "%26") + (string.IsNullOrEmpty(name) ? "" : "%26name=" + name).Replace("&", "%26") ?? string.Empty; HttpCookie cook = Request.Cookies["owzx_user"]; if (cook != null) { if (cook["status"] == "1") { string operateip = Common.Common.GetRequestIP(); int result; OWZXEntity.Manage.M_Users model = M_UsersBusiness.GetM_UserByProUserName(cook["username"], cook["pwd"], operateip, out result);; if (model != null) { Session["ClientManager"] = model; return(Redirect("/Default/Index")); } } else { ViewBag.UserName = cook["username"]; } } ViewBag.IsMobileDevice = OWZXManage.Common.Common.IsMobileDevice(); return(View()); }
/// <summary> /// 是否有权限 /// </summary> public static string IsLimits(HttpContext httpContext, string menucode) { if (httpContext.Session["ClientManager"] != null) { OWZXEntity.Manage.M_Users model = (OWZXEntity.Manage.M_Users)httpContext.Session["ClientManager"]; if (model.Menus.Where(m => m.MenuCode == menucode).Count() > 0) { return(""); } } return("nolimits"); }