You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

28 lines
688 B

using System.Web.Mvc;
using System.Web.Routing;
using Pingchuan.BeijingSafeguard.Model;
namespace Pingchuan.BeijingSafeguard.App.Controllers
{
public class BaseController : Controller
{
public const string UserInfoSessionKey = "UserInfoSessionKey";
protected override void Initialize(RequestContext requestContext)
{
base.Initialize(requestContext);
ViewBag.LoginUser = GetLoginUser();
}
public void SetLoginUser(User user)
{
Session[UserInfoSessionKey] = user;
}
public User GetLoginUser()
{
return (User)Session[UserInfoSessionKey];
}
}
}