移除不用的Menus集合

This commit is contained in:
Argo-Lenovo 2016-12-22 16:26:42 +08:00
parent 1d41b6b3a7
commit 80972be861
2 changed files with 2 additions and 11 deletions

View File

@ -19,11 +19,7 @@ namespace Bootstrap.Admin.Controllers
{
var v = new HeaderBarModel();
v.HomeUrl = DictHelper.RetrieveHomeUrl();
if (v.HomeUrl.StartsWith("~/"))
{
v.Menus = MenuHelper.RetrieveLinksByUserName(User.Identity.Name);
return View(v);
}
if (v.HomeUrl.StartsWith("~/")) return View(v);
else return Redirect(v.HomeUrl);
}
/// <summary>
@ -56,6 +52,7 @@ namespace Bootstrap.Admin.Controllers
if (LgbPrincipal.IsAdmin(userName, password) || UserHelper.Authenticate(userName, password))
{
FormsAuthentication.RedirectFromLoginPage(userName, remember == "true");
return new EmptyResult();
}
return View(model);
}

View File

@ -1,5 +1,4 @@
using Bootstrap.DataAccess;
using System.Collections.Generic;
using System.Web;
namespace Bootstrap.Admin.Models
@ -16,7 +15,6 @@ namespace Bootstrap.Admin.Models
DisplayName = user.DisplayName;
UserName = user.UserName;
UserID = user.ID;
Menus = new List<Menu>();
}
public string UserName { get; protected set; }
/// <summary>
@ -32,10 +30,6 @@ namespace Bootstrap.Admin.Models
/// </summary>
public string HomeUrl { get; set; }
/// <summary>
/// 获得/设置 前台菜单
/// </summary>
public IEnumerable<Menu> Menus { get; set; }
/// <summary>
/// 获得/设置 用户头像地址
/// </summary>
public string Icon { get; set; }