diff --git a/OpenAuth.App/DTO/MenuForUserRequest.cs b/OpenAuth.App/DTO/MenuForUserRequest.cs new file mode 100644 index 00000000..58197d03 --- /dev/null +++ b/OpenAuth.App/DTO/MenuForUserRequest.cs @@ -0,0 +1,12 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace OpenAuth.App.DTO +{ + public class MenuForUserRequest + { + public string UserId { get; set; } + } +} diff --git a/OpenAuth.App/DTO/MenuForUserResponse.cs b/OpenAuth.App/DTO/MenuForUserResponse.cs new file mode 100644 index 00000000..58e6afd0 --- /dev/null +++ b/OpenAuth.App/DTO/MenuForUserResponse.cs @@ -0,0 +1,15 @@ +锘縰sing System.Collections.Generic; +using OpenAuth.Domain.Model; + +namespace OpenAuth.App.DTO +{ + public class MenuForUserResponse + { + private IList _menus = new List(); + + public IList Menus + { + get { return _menus; } + } + } +} diff --git a/OpenAuth.App/LoginApp.cs b/OpenAuth.App/LoginApp.cs index b4166d37..d73bf954 100644 --- a/OpenAuth.App/LoginApp.cs +++ b/OpenAuth.App/LoginApp.cs @@ -1,3 +1,4 @@ +using System; using System.Linq; using System.Security.Cryptography; using OpenAuth.App.DTO; @@ -10,37 +11,27 @@ namespace OpenAuth.App { private LoginService _loginService; - public LoginApp(IUserRepository repository) + public LoginApp(LoginService service) { - _loginService = new LoginService(repository); + _loginService = service; } public LoginResponse Login(LoginRequest request) { var resp = new LoginResponse {UserName = request.UserName}; - var user = _loginService.Login(request.UserName, request.Password); - if (user == null) + try { - resp.Message = "用户名不存在"; - } - else if (!user.Password.Equals(request.Password)) - { - resp.Message = "密码错误"; - } - else if (!user.Enabled) - { - resp.Message = "该用户被禁用"; - } - else - { - resp.UserId = user.UserId; + var user = _loginService.Login(request.UserName, request.Password); + resp.UserId = user.Id; resp.Success = true; - foreach (var role in user.Roles) - { - resp.UserRoleNames.Add(role.FullName); - } } + catch (Exception ex) + { + resp.Success = false; + resp.Message = ex.Message; + } + return resp; } } diff --git a/OpenAuth.App/LoginCacheApp.cs b/OpenAuth.App/LoginCacheApp.cs new file mode 100644 index 00000000..570e1a60 --- /dev/null +++ b/OpenAuth.App/LoginCacheApp.cs @@ -0,0 +1,26 @@ +锘縰sing System.Web; + +using OpenAuth.App.DTO; + +namespace OpenAuth.App +{ + public class LoginCacheApp + { + public static LoginResponse GetLogin() + { + var session = HttpContext.Current.Session; + return session["Login"] as LoginResponse; + } + + public static void SetLogin(LoginResponse loginresp) + { + var session = HttpContext.Current.Session; + var login = session["Login"] as LoginResponse; + if (login != null && login.UserId == loginresp.UserId) + { + return; + } + session["Login"] = loginresp; + } + } +} diff --git a/OpenAuth.App/MenuApp.cs b/OpenAuth.App/MenuApp.cs new file mode 100644 index 00000000..24b2c429 --- /dev/null +++ b/OpenAuth.App/MenuApp.cs @@ -0,0 +1,39 @@ +锘// *********************************************************************** +// Assembly : OpenAuth.App +// Author : yubaolee +// Created : 05-19-2015 +// +// Last Modified By : yubaolee +// Last Modified On : 05-20-2015 +// *********************************************************************** +// +// Copyright (c) Microsoft. All rights reserved. +// +// 鑿滃崟鏈嶅姟 +// *********************************************************************** +using System.Collections.Generic; +using OpenAuth.App.DTO; +using OpenAuth.Domain.Model; +using OpenAuth.Domain.Service; + +namespace OpenAuth.App +{ + public class MenuApp + { + private MenuService _menuService; + + public MenuApp(MenuService service) + { + _menuService = service; + } + public MenuForUserResponse LoadFor(MenuForUserRequest request) + { + var response = new MenuForUserResponse(); + foreach (var menu in _menuService.GetMenuFor(request.UserId)) + { + response.Menus.Add(menu); + } + return response; + } + } +} \ No newline at end of file diff --git a/OpenAuth.App/OpenAuth.App.csproj b/OpenAuth.App/OpenAuth.App.csproj index e9921809..5d2c3652 100644 --- a/OpenAuth.App/OpenAuth.App.csproj +++ b/OpenAuth.App/OpenAuth.App.csproj @@ -32,6 +32,7 @@ + @@ -41,7 +42,11 @@ + + + + diff --git a/OpenAuth.Domain/Interface/IMenuRepository.cs b/OpenAuth.Domain/Interface/IMenuRepository.cs new file mode 100644 index 00000000..8ac2e3b4 --- /dev/null +++ b/OpenAuth.Domain/Interface/IMenuRepository.cs @@ -0,0 +1,12 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using OpenAuth.Domain.Model; + +namespace OpenAuth.Domain.Interface +{ + public interface IMenuRepository + { + } +} diff --git a/OpenAuth.Domain/Interface/IUserRepository.cs b/OpenAuth.Domain/Interface/IUserRepository.cs index 6eb1b41d..7c37458e 100644 --- a/OpenAuth.Domain/Interface/IUserRepository.cs +++ b/OpenAuth.Domain/Interface/IUserRepository.cs @@ -1,9 +1,12 @@ +using System.Collections.Generic; using OpenAuth.Domain.Model; namespace OpenAuth.Domain.Interface { public interface IUserRepository { - User FindBy(string username); + User FindByAccount(string account); + User FindById(string id); + } } \ No newline at end of file diff --git a/OpenAuth.Domain/Model/User.cs b/OpenAuth.Domain/Model/User.cs index bea4e651..5a3b02dc 100644 --- a/OpenAuth.Domain/Model/User.cs +++ b/OpenAuth.Domain/Model/User.cs @@ -1,9 +1,10 @@ using System; using System.Collections.Generic; +using OpenAuth.Domain.Utility; namespace OpenAuth.Domain.Model { - public partial class User + public partial class User :EntityBase { public User() { @@ -11,7 +12,6 @@ namespace OpenAuth.Domain.Model this.Roles = new List(); } - public string UserId { get; set; } public string Account { get; set; } public string Password { get; set; } public string RealName { get; set; } @@ -23,5 +23,10 @@ namespace OpenAuth.Domain.Model public Role DefaultRole { get; set; } + protected override void Validate() + { + if(string.IsNullOrEmpty(Account)) + AddBrokenRule(new BusinessRule("Account","用户帐号不能为空")); + } } } diff --git a/OpenAuth.Domain/OpenAuth.Domain.csproj b/OpenAuth.Domain/OpenAuth.Domain.csproj index a0c8e484..0c3c224b 100644 --- a/OpenAuth.Domain/OpenAuth.Domain.csproj +++ b/OpenAuth.Domain/OpenAuth.Domain.csproj @@ -39,6 +39,7 @@ + @@ -49,6 +50,14 @@ + + + + + + + + diff --git a/OpenAuth.Domain/Service/LoginService.cs b/OpenAuth.Domain/Service/LoginService.cs index 4e5d9300..ddff5b31 100644 --- a/OpenAuth.Domain/Service/LoginService.cs +++ b/OpenAuth.Domain/Service/LoginService.cs @@ -1,26 +1,31 @@ 锘縰sing System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using OpenAuth.Domain.Interface; using OpenAuth.Domain.Model; - namespace OpenAuth.Domain.Service { public class LoginService { private IUserRepository _userRepository; - public LoginService(IUserRepository repository) { _userRepository = repository; } - public User Login(string username, string password) { - return _userRepository.FindBy(username); - + var user = _userRepository.FindByAccount(username); + if (user == null) + { + throw new Exception("鐢ㄦ埛鍚嶄笉瀛樺湪"); + } + if (!user.Password.Equals(password)) + { + throw new Exception("瀵嗙爜閿欒"); + } + if (!user.Enabled) + { + throw new Exception("璇ョ敤鎴疯绂佺敤"); + } + return user; } - } } diff --git a/OpenAuth.Domain/Service/MenuService.cs b/OpenAuth.Domain/Service/MenuService.cs new file mode 100644 index 00000000..95781e38 --- /dev/null +++ b/OpenAuth.Domain/Service/MenuService.cs @@ -0,0 +1,34 @@ +锘縰sing System.Collections.Generic; +using System.Linq; +using OpenAuth.Domain.Interface; +using OpenAuth.Domain.Model; + +namespace OpenAuth.Domain.Service +{ + public class MenuService + { + private IUserRepository _userRepository; + + public MenuService(IUserRepository repository) + { + _userRepository = repository; + } + + public List GetMenuFor(string userId) + { + var menus = new List(); + var user = _userRepository.FindById(userId); + if (user != null) + { + foreach (var role in user.Roles) + { + foreach (var menu in role.RoleMenus.Where(menu => !menus.Exists(e =>e.MenuId == menu.MenuId))) + { + menus.Add(menu); + } + } + } + return menus; + } + } +} diff --git a/OpenAuth.Domain/Utility/BusinessRule.cs b/OpenAuth.Domain/Utility/BusinessRule.cs new file mode 100644 index 00000000..d0010227 --- /dev/null +++ b/OpenAuth.Domain/Utility/BusinessRule.cs @@ -0,0 +1,27 @@ +锘縩amespace OpenAuth.Domain.Utility +{ + public class BusinessRule + { + private string _property; + private string _rule; + + public BusinessRule(string property, string rule) + { + this._property = property; + this._rule = rule; + } + + public string Property + { + get { return _property; } + set { _property = value; } + } + + public string Rule + { + get { return _rule; } + set { _rule = value; } + } + } + +} diff --git a/OpenAuth.Domain/Utility/EntityBase.cs b/OpenAuth.Domain/Utility/EntityBase.cs new file mode 100644 index 00000000..dfbcd702 --- /dev/null +++ b/OpenAuth.Domain/Utility/EntityBase.cs @@ -0,0 +1,65 @@ +锘縰sing System.Collections.Generic; + +namespace OpenAuth.Domain.Utility +{ + public abstract class EntityBase + { + private List _brokenRules = new List(); + + public TId Id { get; set; } + + protected abstract void Validate(); + + public IEnumerable GetBrokenRules() + { + _brokenRules.Clear(); + Validate(); + return _brokenRules; + } + + protected void AddBrokenRule(BusinessRule businessRule) + { + _brokenRules.Add(businessRule); + } + + public override bool Equals(object entity) + { + return entity != null + && entity is EntityBase + && this == (EntityBase)entity; + } + + public override int GetHashCode() + { + return this.Id.GetHashCode(); + } + + public static bool operator ==(EntityBase entity1, + EntityBase entity2) + { + if ((object)entity1 == null && (object)entity2 == null) + { + return true; + } + + if ((object)entity1 == null || (object)entity2 == null) + { + return false; + } + + if (entity1.Id.ToString() == entity2.Id.ToString()) + { + return true; + } + + return false; + } + + public static bool operator !=(EntityBase entity1, + EntityBase entity2) + { + return (!(entity1 == entity2)); + } + } + +} diff --git a/OpenAuth.Domain/Utility/IAggregateRoot.cs b/OpenAuth.Domain/Utility/IAggregateRoot.cs new file mode 100644 index 00000000..805032ff --- /dev/null +++ b/OpenAuth.Domain/Utility/IAggregateRoot.cs @@ -0,0 +1,7 @@ +锘縩amespace OpenAuth.Domain.Utility +{ + public interface IAggregateRoot + { + } + +} diff --git a/OpenAuth.Domain/Utility/IReadOnlyRepository.cs b/OpenAuth.Domain/Utility/IReadOnlyRepository.cs new file mode 100644 index 00000000..71985e71 --- /dev/null +++ b/OpenAuth.Domain/Utility/IReadOnlyRepository.cs @@ -0,0 +1,11 @@ +锘縰sing System.Collections.Generic; + +namespace OpenAuth.Domain.Utility +{ + public interface IReadOnlyRepository where T : IAggregateRoot + { + T FindBy(TId id); + IEnumerable FindAll(); + + } +} diff --git a/OpenAuth.Domain/Utility/IRepository.cs b/OpenAuth.Domain/Utility/IRepository.cs new file mode 100644 index 00000000..bfc8dcaf --- /dev/null +++ b/OpenAuth.Domain/Utility/IRepository.cs @@ -0,0 +1,10 @@ +锘縩amespace OpenAuth.Domain.Utility +{ + public interface IRepository : IReadOnlyRepository where T : IAggregateRoot + { + void Save(T entity); + void Add(T entity); + void Remove(T entity); + } +} + diff --git a/OpenAuth.Domain/Utility/ValueObjectBase.cs b/OpenAuth.Domain/Utility/ValueObjectBase.cs new file mode 100644 index 00000000..6f97c124 --- /dev/null +++ b/OpenAuth.Domain/Utility/ValueObjectBase.cs @@ -0,0 +1,36 @@ +锘縰sing System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace OpenAuth.Domain.Utility +{ + public abstract class ValueObjectBase + { + private List _brokenRules = new List(); + + public ValueObjectBase() + { + } + + protected abstract void Validate(); + + public void ThrowExceptionIfInvalid() + { + _brokenRules.Clear(); + Validate(); + if (_brokenRules.Count() > 0) + { + StringBuilder issues = new StringBuilder(); + foreach (BusinessRule businessRule in _brokenRules) + issues.AppendLine(businessRule.Rule); + + throw new ValueObjectIsInvalidException(issues.ToString()); + } + } + + protected void AddBrokenRule(BusinessRule businessRule) + { + _brokenRules.Add(businessRule); + } + } +} diff --git a/OpenAuth.Domain/Utility/ValueObjectIsInvalidException.cs b/OpenAuth.Domain/Utility/ValueObjectIsInvalidException.cs new file mode 100644 index 00000000..73535a8a --- /dev/null +++ b/OpenAuth.Domain/Utility/ValueObjectIsInvalidException.cs @@ -0,0 +1,13 @@ +锘縰sing System; + +namespace OpenAuth.Domain.Utility +{ + public class ValueObjectIsInvalidException : Exception + { + public ValueObjectIsInvalidException(string message) + : base(message) + { + + } + } +} \ No newline at end of file diff --git a/OpenAuth.Infrastructure/Mapping/UserMap.cs b/OpenAuth.Infrastructure/Mapping/UserMap.cs index 723772ad..6f3a3747 100644 --- a/OpenAuth.Infrastructure/Mapping/UserMap.cs +++ b/OpenAuth.Infrastructure/Mapping/UserMap.cs @@ -9,10 +9,10 @@ namespace OpenAuth.Infrastructure.Mapping public UserMap() { // Primary Key - this.HasKey(t => t.UserId); + this.HasKey(t => t.Id); // Properties - this.Property(t => t.UserId) + this.Property(t => t.Id) .IsRequired() .HasMaxLength(50); @@ -53,7 +53,7 @@ namespace OpenAuth.Infrastructure.Mapping // Table & Column Mappings this.ToTable("User"); - this.Property(t => t.UserId).HasColumnName("UserId"); + this.Property(t => t.Id).HasColumnName("UserId"); this.Property(t => t.Account).HasColumnName("Account"); this.Property(t => t.Password).HasColumnName("Password"); this.Property(t => t.RealName).HasColumnName("RealName"); diff --git a/OpenAuth.Infrastructure/Repository/UserRepository.cs b/OpenAuth.Infrastructure/Repository/UserRepository.cs index 8209433e..2b474e02 100644 --- a/OpenAuth.Infrastructure/Repository/UserRepository.cs +++ b/OpenAuth.Infrastructure/Repository/UserRepository.cs @@ -9,7 +9,7 @@ namespace OpenAuth.Infrastructure.Repository { public class UserRepository :BaseRepository, IUserRepository { - public User FindBy(string username) + public User FindByAccount(string username) { try { @@ -20,6 +20,18 @@ namespace OpenAuth.Infrastructure.Repository return null; } } + + public User FindById(string id) + { + try + { + return _Context.Users.First(e => e.Id == id); + } + catch (Exception) + { + return null; + } + } } } diff --git a/OpenAuth.UnitTest/IndexTest.cs b/OpenAuth.UnitTest/IndexTest.cs index 28576c22..89676552 100644 --- a/OpenAuth.UnitTest/IndexTest.cs +++ b/OpenAuth.UnitTest/IndexTest.cs @@ -1,6 +1,4 @@ -锘縰sing System; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using OpenAuth.Domain.Model; +锘縰sing Microsoft.VisualStudio.TestTools.UnitTesting; namespace OpenAuth.UnitTest { @@ -10,9 +8,7 @@ namespace OpenAuth.UnitTest [TestMethod] public void MenuTest() { - string userid = ""; - IndexApp app = new IndexApp(); - MenuResponse response = app.LoadMenu(userid); + } } } diff --git a/OpenAuth.UnitTest/LoginTest.cs b/OpenAuth.UnitTest/LoginTest.cs index 396230be..8c1196ca 100644 --- a/OpenAuth.UnitTest/LoginTest.cs +++ b/OpenAuth.UnitTest/LoginTest.cs @@ -1,6 +1,7 @@ 锘縰sing Microsoft.VisualStudio.TestTools.UnitTesting; using OpenAuth.App; using OpenAuth.App.DTO; +using OpenAuth.Domain.Service; using OpenAuth.Infrastructure.Repository; namespace OpenAuth.UnitTest @@ -12,9 +13,8 @@ namespace OpenAuth.UnitTest [TestMethod] public void Login() { - var loginReq = new LoginRequest { UserName = "admin", Password = "123456" }; - var loginApp = new LoginApp(new UserRepository()); + var loginApp = new LoginApp(new LoginService(new UserRepository())); var response = loginApp.Login(loginReq); Assert.IsTrue(response.Success); Assert.AreEqual(response.UserName, loginReq.UserName); diff --git a/OpenAuth.Web/App_Start/RouteConfig.cs b/OpenAuth.Web/App_Start/RouteConfig.cs index 3dcfca81..19b940d4 100644 --- a/OpenAuth.Web/App_Start/RouteConfig.cs +++ b/OpenAuth.Web/App_Start/RouteConfig.cs @@ -16,7 +16,7 @@ namespace OpenAuth.Web routes.MapRoute( name: "Default", url: "{controller}/{action}/{id}", - defaults: new { controller = "Home", action = "Login", id = UrlParameter.Optional } + defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } ); } } diff --git a/OpenAuth.Web/Controllers/AccountController.cs b/OpenAuth.Web/Controllers/AccountController.cs new file mode 100644 index 00000000..fd3d8b22 --- /dev/null +++ b/OpenAuth.Web/Controllers/AccountController.cs @@ -0,0 +1,34 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.Mvc; +using OpenAuth.App; +using OpenAuth.App.DTO; +using OpenAuth.Domain.Service; +using OpenAuth.Infrastructure.Repository; + +namespace OpenAuth.Web.Controllers +{ + public class AccountController : Controller + { + // + // GET: /Account/ + + public ActionResult Login() + { + return View(); + } + + [HttpPost] + public ActionResult Login(string username, string password) + { + var request = new LoginRequest { UserName = username, Password = password }; + var loginApp = new LoginApp(new LoginService(new UserRepository())); + var response = loginApp.Login(request); + LoginCacheApp.SetLogin(response); + return Json(new { response.Success, response.Message }); + } + + } +} diff --git a/OpenAuth.Web/Controllers/HomeController.cs b/OpenAuth.Web/Controllers/HomeController.cs index 5fc5822f..79054af8 100644 --- a/OpenAuth.Web/Controllers/HomeController.cs +++ b/OpenAuth.Web/Controllers/HomeController.cs @@ -1,12 +1,5 @@ -锘縰sing System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.Helpers; -using System.Web.Mvc; +锘縰sing System.Web.Mvc; using OpenAuth.App; -using OpenAuth.App.DTO; -using OpenAuth.Infrastructure.Repository; namespace OpenAuth.Web.Controllers { @@ -17,22 +10,11 @@ namespace OpenAuth.Web.Controllers public ActionResult Index() { + if(LoginCacheApp.GetLogin() == null) + return RedirectToAction("Login", "Account"); return View(); } - public ActionResult Login() - { - return View(); - } - - [HttpPost] - public ActionResult Login(string username, string password) - { - var request = new LoginRequest {UserName = username, Password = password}; - var loginApp = new LoginApp(new UserRepository()); - var response = loginApp.Login(request); - return Json(new{Success= response.Success,Message=response.Message}); - } } } diff --git a/OpenAuth.Web/Controllers/MenuController.cs b/OpenAuth.Web/Controllers/MenuController.cs new file mode 100644 index 00000000..900e3e96 --- /dev/null +++ b/OpenAuth.Web/Controllers/MenuController.cs @@ -0,0 +1,27 @@ +锘縰sing System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.Mvc; +using OpenAuth.App; +using OpenAuth.App.DTO; +using OpenAuth.Domain.Service; +using OpenAuth.Infrastructure.Repository; + +namespace OpenAuth.Web.Controllers +{ + public class MenuController : Controller + { + // + // GET: /Menu/ + + public ActionResult LeftMenu() + { + var service = new MenuService(new UserRepository()); + MenuApp app = new MenuApp(service); + var request = new MenuForUserRequest {UserId = LoginCacheApp.GetLogin().UserId}; + var response = app.LoadFor(request); + return PartialView(response); + } + + } +} diff --git a/OpenAuth.Web/OpenAuth.Web.csproj b/OpenAuth.Web/OpenAuth.Web.csproj index f7ecd819..3c311512 100644 --- a/OpenAuth.Web/OpenAuth.Web.csproj +++ b/OpenAuth.Web/OpenAuth.Web.csproj @@ -40,6 +40,15 @@ + + ..\packages\CommonServiceLocator.1.0\lib\NET35\Microsoft.Practices.ServiceLocation.dll + + + ..\packages\Unity.2.1.505.2\lib\NET35\Microsoft.Practices.Unity.dll + + + ..\packages\Unity.2.1.505.2\lib\NET35\Microsoft.Practices.Unity.Configuration.dll + @@ -112,7 +121,9 @@ + + Global.asax @@ -231,25 +242,25 @@ - - - Code - - - - + Code + + + + + + 10.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) diff --git a/OpenAuth.Web/Views/Home/Login.cshtml b/OpenAuth.Web/Views/Account/Login.cshtml similarity index 96% rename from OpenAuth.Web/Views/Home/Login.cshtml rename to OpenAuth.Web/Views/Account/Login.cshtml index 5b4e22dc..cafa5485 100644 --- a/OpenAuth.Web/Views/Home/Login.cshtml +++ b/OpenAuth.Web/Views/Account/Login.cshtml @@ -57,7 +57,7 @@ - + @@ -68,14 +68,13 @@ - + - @@ -87,12 +86,12 @@ $.ajax({ type: "POST", - url: "/Home/Login", + url: "/Account/Login", data: { username: username, password: password }, - success: function(rel) { + success: function (rel) { if (rel.Success) window.location = "/Home/Index"; else { @@ -106,7 +105,7 @@ ''); } } - + }); } diff --git a/OpenAuth.Web/Views/Home/Header.cshtml b/OpenAuth.Web/Views/Home/Header.cshtml new file mode 100644 index 00000000..ee8b44cd --- /dev/null +++ b/OpenAuth.Web/Views/Home/Header.cshtml @@ -0,0 +1,89 @@ +锘緻using OpenAuth.App + \ No newline at end of file diff --git a/OpenAuth.Web/Views/Home/Index.cshtml b/OpenAuth.Web/Views/Home/Index.cshtml index 1bc391b4..e69688e7 100644 --- a/OpenAuth.Web/Views/Home/Index.cshtml +++ b/OpenAuth.Web/Views/Home/Index.cshtml @@ -2,11 +2,13 @@ Layout = "~/Views/Shared/_Layout.cshtml"; } -@RenderPage("~/Views/Shared/_Header.cshtml") +@RenderPage("~/Views/Home/Header.cshtml")
- @RenderPage("~/Views/Shared/Left.cshtml") -
+@{ + Html.RenderAction("LeftMenu","Menu"); +} +
diff --git a/OpenAuth.Web/Views/Menu/LeftMenu.cshtml b/OpenAuth.Web/Views/Menu/LeftMenu.cshtml new file mode 100644 index 00000000..fb967936 --- /dev/null +++ b/OpenAuth.Web/Views/Menu/LeftMenu.cshtml @@ -0,0 +1,48 @@ +锘緻model OpenAuth.App.DTO.MenuForUserResponse + \ No newline at end of file diff --git a/OpenAuth.Web/Views/Shared/Left.cshtml b/OpenAuth.Web/Views/Shared/Left.cshtml deleted file mode 100644 index fb2912ad..00000000 --- a/OpenAuth.Web/Views/Shared/Left.cshtml +++ /dev/null @@ -1,232 +0,0 @@ -锘 \ No newline at end of file diff --git a/OpenAuth.Web/Views/Shared/_Header.cshtml b/OpenAuth.Web/Views/Shared/_Header.cshtml deleted file mode 100644 index 9403fbea..00000000 --- a/OpenAuth.Web/Views/Shared/_Header.cshtml +++ /dev/null @@ -1,197 +0,0 @@ -锘 \ No newline at end of file diff --git a/OpenAuth.Web/packages.config b/OpenAuth.Web/packages.config index 464d1f3e..2b4ccbe2 100644 --- a/OpenAuth.Web/packages.config +++ b/OpenAuth.Web/packages.config @@ -1,5 +1,6 @@ 锘 + @@ -11,4 +12,5 @@ + \ No newline at end of file diff --git a/OpenAuth.sln b/OpenAuth.sln index 97b3e1e7..7da517c1 100644 --- a/OpenAuth.sln +++ b/OpenAuth.sln @@ -60,4 +60,7 @@ Global {ADAE08C0-DE22-41F7-9F94-0E62AE327C25} = {EE008F5F-FD7F-407F-B201-6486BDE6B9F1} {2E6B5B73-7757-43F0-8AC8-3030F7C191B8} = {C59DF46D-7815-462B-9FFF-750B2120B75B} EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EnterpriseLibraryConfigurationToolBinariesPath = packages\Unity.2.1.505.2\lib\NET35 + EndGlobalSection EndGlobal