mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-04-05 17:38:01 +08:00
主页加载菜单按钮
重新修改了登陆逻辑
This commit is contained in:
parent
91384a5447
commit
b4fc05a823
12
OpenAuth.App/DTO/MenuForUserRequest.cs
Normal file
12
OpenAuth.App/DTO/MenuForUserRequest.cs
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace OpenAuth.App.DTO
|
||||||
|
{
|
||||||
|
public class MenuForUserRequest
|
||||||
|
{
|
||||||
|
public string UserId { get; set; }
|
||||||
|
}
|
||||||
|
}
|
15
OpenAuth.App/DTO/MenuForUserResponse.cs
Normal file
15
OpenAuth.App/DTO/MenuForUserResponse.cs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using OpenAuth.Domain.Model;
|
||||||
|
|
||||||
|
namespace OpenAuth.App.DTO
|
||||||
|
{
|
||||||
|
public class MenuForUserResponse
|
||||||
|
{
|
||||||
|
private IList<Menu> _menus = new List<Menu>();
|
||||||
|
|
||||||
|
public IList<Menu> Menus
|
||||||
|
{
|
||||||
|
get { return _menus; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,3 +1,4 @@
|
|||||||
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
using OpenAuth.App.DTO;
|
using OpenAuth.App.DTO;
|
||||||
@ -10,37 +11,27 @@ namespace OpenAuth.App
|
|||||||
{
|
{
|
||||||
private LoginService _loginService;
|
private LoginService _loginService;
|
||||||
|
|
||||||
public LoginApp(IUserRepository repository)
|
public LoginApp(LoginService service)
|
||||||
{
|
{
|
||||||
_loginService = new LoginService(repository);
|
_loginService = service;
|
||||||
}
|
}
|
||||||
|
|
||||||
public LoginResponse Login(LoginRequest request)
|
public LoginResponse Login(LoginRequest request)
|
||||||
{
|
{
|
||||||
var resp = new LoginResponse {UserName = request.UserName};
|
var resp = new LoginResponse {UserName = request.UserName};
|
||||||
|
|
||||||
var user = _loginService.Login(request.UserName, request.Password);
|
try
|
||||||
if (user == null)
|
|
||||||
{
|
{
|
||||||
resp.Message = "用户名不存在";
|
var user = _loginService.Login(request.UserName, request.Password);
|
||||||
}
|
resp.UserId = user.Id;
|
||||||
else if (!user.Password.Equals(request.Password))
|
|
||||||
{
|
|
||||||
resp.Message = "密码错误";
|
|
||||||
}
|
|
||||||
else if (!user.Enabled)
|
|
||||||
{
|
|
||||||
resp.Message = "该用户被禁用";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
resp.UserId = user.UserId;
|
|
||||||
resp.Success = true;
|
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;
|
return resp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
26
OpenAuth.App/LoginCacheApp.cs
Normal file
26
OpenAuth.App/LoginCacheApp.cs
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
using 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
39
OpenAuth.App/MenuApp.cs
Normal file
39
OpenAuth.App/MenuApp.cs
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
// ***********************************************************************
|
||||||
|
// Assembly : OpenAuth.App
|
||||||
|
// Author : yubaolee
|
||||||
|
// Created : 05-19-2015
|
||||||
|
//
|
||||||
|
// Last Modified By : yubaolee
|
||||||
|
// Last Modified On : 05-20-2015
|
||||||
|
// ***********************************************************************
|
||||||
|
// <copyright file="MenuApp.cs" company="Microsoft">
|
||||||
|
// Copyright (c) Microsoft. All rights reserved.
|
||||||
|
// </copyright>
|
||||||
|
// <summary>菜单服务</summary>
|
||||||
|
// ***********************************************************************
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -32,6 +32,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.Web" />
|
||||||
<Reference Include="System.Xml.Linq" />
|
<Reference Include="System.Xml.Linq" />
|
||||||
<Reference Include="System.Data.DataSetExtensions" />
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
<Reference Include="Microsoft.CSharp" />
|
<Reference Include="Microsoft.CSharp" />
|
||||||
@ -41,7 +42,11 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="DTO\LoginRequest.cs" />
|
<Compile Include="DTO\LoginRequest.cs" />
|
||||||
<Compile Include="DTO\LoginResponse.cs" />
|
<Compile Include="DTO\LoginResponse.cs" />
|
||||||
|
<Compile Include="DTO\MenuForUserRequest.cs" />
|
||||||
|
<Compile Include="DTO\MenuForUserResponse.cs" />
|
||||||
<Compile Include="LoginApp.cs" />
|
<Compile Include="LoginApp.cs" />
|
||||||
|
<Compile Include="LoginCacheApp.cs" />
|
||||||
|
<Compile Include="MenuApp.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="DTO\Response.cs" />
|
<Compile Include="DTO\Response.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
12
OpenAuth.Domain/Interface/IMenuRepository.cs
Normal file
12
OpenAuth.Domain/Interface/IMenuRepository.cs
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using OpenAuth.Domain.Model;
|
||||||
|
|
||||||
|
namespace OpenAuth.Domain.Interface
|
||||||
|
{
|
||||||
|
public interface IMenuRepository
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
@ -1,9 +1,12 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
using OpenAuth.Domain.Model;
|
using OpenAuth.Domain.Model;
|
||||||
|
|
||||||
namespace OpenAuth.Domain.Interface
|
namespace OpenAuth.Domain.Interface
|
||||||
{
|
{
|
||||||
public interface IUserRepository
|
public interface IUserRepository
|
||||||
{
|
{
|
||||||
User FindBy(string username);
|
User FindByAccount(string account);
|
||||||
|
User FindById(string id);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,9 +1,10 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using OpenAuth.Domain.Utility;
|
||||||
|
|
||||||
namespace OpenAuth.Domain.Model
|
namespace OpenAuth.Domain.Model
|
||||||
{
|
{
|
||||||
public partial class User
|
public partial class User :EntityBase<string>
|
||||||
{
|
{
|
||||||
public User()
|
public User()
|
||||||
{
|
{
|
||||||
@ -11,7 +12,6 @@ namespace OpenAuth.Domain.Model
|
|||||||
this.Roles = new List<Role>();
|
this.Roles = new List<Role>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public string UserId { get; set; }
|
|
||||||
public string Account { get; set; }
|
public string Account { get; set; }
|
||||||
public string Password { get; set; }
|
public string Password { get; set; }
|
||||||
public string RealName { get; set; }
|
public string RealName { get; set; }
|
||||||
@ -23,5 +23,10 @@ namespace OpenAuth.Domain.Model
|
|||||||
|
|
||||||
public Role DefaultRole { get; set; }
|
public Role DefaultRole { get; set; }
|
||||||
|
|
||||||
|
protected override void Validate()
|
||||||
|
{
|
||||||
|
if(string.IsNullOrEmpty(Account))
|
||||||
|
AddBrokenRule(new BusinessRule("Account","用户帐号不能为空"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -39,6 +39,7 @@
|
|||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Compile Include="Interface\IMenuRepository.cs" />
|
||||||
<Compile Include="Interface\IUserRepository.cs" />
|
<Compile Include="Interface\IUserRepository.cs" />
|
||||||
<Compile Include="Model\Button.cs" />
|
<Compile Include="Model\Button.cs" />
|
||||||
<Compile Include="Model\DataPermission.cs" />
|
<Compile Include="Model\DataPermission.cs" />
|
||||||
@ -49,6 +50,14 @@
|
|||||||
<Compile Include="Model\Role.cs" />
|
<Compile Include="Model\Role.cs" />
|
||||||
<Compile Include="Model\User.cs" />
|
<Compile Include="Model\User.cs" />
|
||||||
<Compile Include="Service\LoginService.cs" />
|
<Compile Include="Service\LoginService.cs" />
|
||||||
|
<Compile Include="Service\MenuService.cs" />
|
||||||
|
<Compile Include="Utility\BusinessRule.cs" />
|
||||||
|
<Compile Include="Utility\EntityBase.cs" />
|
||||||
|
<Compile Include="Utility\IAggregateRoot.cs" />
|
||||||
|
<Compile Include="Utility\IReadOnlyRepository.cs" />
|
||||||
|
<Compile Include="Utility\IRepository.cs" />
|
||||||
|
<Compile Include="Utility\ValueObjectBase.cs" />
|
||||||
|
<Compile Include="Utility\ValueObjectIsInvalidException.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup />
|
<ItemGroup />
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
@ -1,26 +1,31 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using OpenAuth.Domain.Interface;
|
using OpenAuth.Domain.Interface;
|
||||||
using OpenAuth.Domain.Model;
|
using OpenAuth.Domain.Model;
|
||||||
|
|
||||||
namespace OpenAuth.Domain.Service
|
namespace OpenAuth.Domain.Service
|
||||||
{
|
{
|
||||||
public class LoginService
|
public class LoginService
|
||||||
{
|
{
|
||||||
private IUserRepository _userRepository;
|
private IUserRepository _userRepository;
|
||||||
|
|
||||||
public LoginService(IUserRepository repository)
|
public LoginService(IUserRepository repository)
|
||||||
{
|
{
|
||||||
_userRepository = repository;
|
_userRepository = repository;
|
||||||
}
|
}
|
||||||
|
|
||||||
public User Login(string username, string password)
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
34
OpenAuth.Domain/Service/MenuService.cs
Normal file
34
OpenAuth.Domain/Service/MenuService.cs
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
using 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<Menu> GetMenuFor(string userId)
|
||||||
|
{
|
||||||
|
var menus = new List<Menu>();
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
27
OpenAuth.Domain/Utility/BusinessRule.cs
Normal file
27
OpenAuth.Domain/Utility/BusinessRule.cs
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
namespace 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; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
65
OpenAuth.Domain/Utility/EntityBase.cs
Normal file
65
OpenAuth.Domain/Utility/EntityBase.cs
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace OpenAuth.Domain.Utility
|
||||||
|
{
|
||||||
|
public abstract class EntityBase<TId>
|
||||||
|
{
|
||||||
|
private List<BusinessRule> _brokenRules = new List<BusinessRule>();
|
||||||
|
|
||||||
|
public TId Id { get; set; }
|
||||||
|
|
||||||
|
protected abstract void Validate();
|
||||||
|
|
||||||
|
public IEnumerable<BusinessRule> 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<TId>
|
||||||
|
&& this == (EntityBase<TId>)entity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override int GetHashCode()
|
||||||
|
{
|
||||||
|
return this.Id.GetHashCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool operator ==(EntityBase<TId> entity1,
|
||||||
|
EntityBase<TId> 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<TId> entity1,
|
||||||
|
EntityBase<TId> entity2)
|
||||||
|
{
|
||||||
|
return (!(entity1 == entity2));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
7
OpenAuth.Domain/Utility/IAggregateRoot.cs
Normal file
7
OpenAuth.Domain/Utility/IAggregateRoot.cs
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
namespace OpenAuth.Domain.Utility
|
||||||
|
{
|
||||||
|
public interface IAggregateRoot
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
11
OpenAuth.Domain/Utility/IReadOnlyRepository.cs
Normal file
11
OpenAuth.Domain/Utility/IReadOnlyRepository.cs
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace OpenAuth.Domain.Utility
|
||||||
|
{
|
||||||
|
public interface IReadOnlyRepository<T, TId> where T : IAggregateRoot
|
||||||
|
{
|
||||||
|
T FindBy(TId id);
|
||||||
|
IEnumerable<T> FindAll();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
10
OpenAuth.Domain/Utility/IRepository.cs
Normal file
10
OpenAuth.Domain/Utility/IRepository.cs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
namespace OpenAuth.Domain.Utility
|
||||||
|
{
|
||||||
|
public interface IRepository<T, TId> : IReadOnlyRepository<T, TId> where T : IAggregateRoot
|
||||||
|
{
|
||||||
|
void Save(T entity);
|
||||||
|
void Add(T entity);
|
||||||
|
void Remove(T entity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
36
OpenAuth.Domain/Utility/ValueObjectBase.cs
Normal file
36
OpenAuth.Domain/Utility/ValueObjectBase.cs
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace OpenAuth.Domain.Utility
|
||||||
|
{
|
||||||
|
public abstract class ValueObjectBase
|
||||||
|
{
|
||||||
|
private List<BusinessRule> _brokenRules = new List<BusinessRule>();
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
13
OpenAuth.Domain/Utility/ValueObjectIsInvalidException.cs
Normal file
13
OpenAuth.Domain/Utility/ValueObjectIsInvalidException.cs
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace OpenAuth.Domain.Utility
|
||||||
|
{
|
||||||
|
public class ValueObjectIsInvalidException : Exception
|
||||||
|
{
|
||||||
|
public ValueObjectIsInvalidException(string message)
|
||||||
|
: base(message)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -9,10 +9,10 @@ namespace OpenAuth.Infrastructure.Mapping
|
|||||||
public UserMap()
|
public UserMap()
|
||||||
{
|
{
|
||||||
// Primary Key
|
// Primary Key
|
||||||
this.HasKey(t => t.UserId);
|
this.HasKey(t => t.Id);
|
||||||
|
|
||||||
// Properties
|
// Properties
|
||||||
this.Property(t => t.UserId)
|
this.Property(t => t.Id)
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasMaxLength(50);
|
.HasMaxLength(50);
|
||||||
|
|
||||||
@ -53,7 +53,7 @@ namespace OpenAuth.Infrastructure.Mapping
|
|||||||
|
|
||||||
// Table & Column Mappings
|
// Table & Column Mappings
|
||||||
this.ToTable("User");
|
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.Account).HasColumnName("Account");
|
||||||
this.Property(t => t.Password).HasColumnName("Password");
|
this.Property(t => t.Password).HasColumnName("Password");
|
||||||
this.Property(t => t.RealName).HasColumnName("RealName");
|
this.Property(t => t.RealName).HasColumnName("RealName");
|
||||||
|
@ -9,7 +9,7 @@ namespace OpenAuth.Infrastructure.Repository
|
|||||||
{
|
{
|
||||||
public class UserRepository :BaseRepository, IUserRepository
|
public class UserRepository :BaseRepository, IUserRepository
|
||||||
{
|
{
|
||||||
public User FindBy(string username)
|
public User FindByAccount(string username)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -20,6 +20,18 @@ namespace OpenAuth.Infrastructure.Repository
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public User FindById(string id)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return _Context.Users.First(e => e.Id == id);
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
using System;
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
||||||
using OpenAuth.Domain.Model;
|
|
||||||
|
|
||||||
namespace OpenAuth.UnitTest
|
namespace OpenAuth.UnitTest
|
||||||
{
|
{
|
||||||
@ -10,9 +8,7 @@ namespace OpenAuth.UnitTest
|
|||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void MenuTest()
|
public void MenuTest()
|
||||||
{
|
{
|
||||||
string userid = "";
|
|
||||||
IndexApp app = new IndexApp();
|
|
||||||
MenuResponse response = app.LoadMenu(userid);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||||
using OpenAuth.App;
|
using OpenAuth.App;
|
||||||
using OpenAuth.App.DTO;
|
using OpenAuth.App.DTO;
|
||||||
|
using OpenAuth.Domain.Service;
|
||||||
using OpenAuth.Infrastructure.Repository;
|
using OpenAuth.Infrastructure.Repository;
|
||||||
|
|
||||||
namespace OpenAuth.UnitTest
|
namespace OpenAuth.UnitTest
|
||||||
@ -12,9 +13,8 @@ namespace OpenAuth.UnitTest
|
|||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void Login()
|
public void Login()
|
||||||
{
|
{
|
||||||
|
|
||||||
var loginReq = new LoginRequest { UserName = "admin", Password = "123456" };
|
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);
|
var response = loginApp.Login(loginReq);
|
||||||
Assert.IsTrue(response.Success);
|
Assert.IsTrue(response.Success);
|
||||||
Assert.AreEqual(response.UserName, loginReq.UserName);
|
Assert.AreEqual(response.UserName, loginReq.UserName);
|
||||||
|
@ -16,7 +16,7 @@ namespace OpenAuth.Web
|
|||||||
routes.MapRoute(
|
routes.MapRoute(
|
||||||
name: "Default",
|
name: "Default",
|
||||||
url: "{controller}/{action}/{id}",
|
url: "{controller}/{action}/{id}",
|
||||||
defaults: new { controller = "Home", action = "Login", id = UrlParameter.Optional }
|
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
34
OpenAuth.Web/Controllers/AccountController.cs
Normal file
34
OpenAuth.Web/Controllers/AccountController.cs
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
using 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 });
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -1,12 +1,5 @@
|
|||||||
using System;
|
using System.Web.Mvc;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Web;
|
|
||||||
using System.Web.Helpers;
|
|
||||||
using System.Web.Mvc;
|
|
||||||
using OpenAuth.App;
|
using OpenAuth.App;
|
||||||
using OpenAuth.App.DTO;
|
|
||||||
using OpenAuth.Infrastructure.Repository;
|
|
||||||
|
|
||||||
namespace OpenAuth.Web.Controllers
|
namespace OpenAuth.Web.Controllers
|
||||||
{
|
{
|
||||||
@ -17,22 +10,11 @@ namespace OpenAuth.Web.Controllers
|
|||||||
|
|
||||||
public ActionResult Index()
|
public ActionResult Index()
|
||||||
{
|
{
|
||||||
|
if(LoginCacheApp.GetLogin() == null)
|
||||||
|
return RedirectToAction("Login", "Account");
|
||||||
return View();
|
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});
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
27
OpenAuth.Web/Controllers/MenuController.cs
Normal file
27
OpenAuth.Web/Controllers/MenuController.cs
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
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 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -40,6 +40,15 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="Microsoft.CSharp" />
|
<Reference Include="Microsoft.CSharp" />
|
||||||
|
<Reference Include="Microsoft.Practices.ServiceLocation">
|
||||||
|
<HintPath>..\packages\CommonServiceLocator.1.0\lib\NET35\Microsoft.Practices.ServiceLocation.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Practices.Unity">
|
||||||
|
<HintPath>..\packages\Unity.2.1.505.2\lib\NET35\Microsoft.Practices.Unity.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Practices.Unity.Configuration">
|
||||||
|
<HintPath>..\packages\Unity.2.1.505.2\lib\NET35\Microsoft.Practices.Unity.Configuration.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Data" />
|
<Reference Include="System.Data" />
|
||||||
<Reference Include="System.Drawing" />
|
<Reference Include="System.Drawing" />
|
||||||
@ -112,7 +121,9 @@
|
|||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Compile Include="Controllers\AccountController.cs" />
|
||||||
<Compile Include="Controllers\HomeController.cs" />
|
<Compile Include="Controllers\HomeController.cs" />
|
||||||
|
<Compile Include="Controllers\MenuController.cs" />
|
||||||
<Compile Include="Global.asax.cs">
|
<Compile Include="Global.asax.cs">
|
||||||
<DependentUpon>Global.asax</DependentUpon>
|
<DependentUpon>Global.asax</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
@ -231,25 +242,25 @@
|
|||||||
<Content Include="Content\font\DXI1ORHCpsQm3Vp6mXoaTXhCUOGz7vYGh680lGh-uXM.woff" />
|
<Content Include="Content\font\DXI1ORHCpsQm3Vp6mXoaTXhCUOGz7vYGh680lGh-uXM.woff" />
|
||||||
<Content Include="Content\font\fontawesome-webfont.woff" />
|
<Content Include="Content\font\fontawesome-webfont.woff" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
|
||||||
<Content Include="Views\Home\Login.cshtml" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="Views\Shared\_Layout.cshtml">
|
<Content Include="Views\Shared\_Layout.cshtml">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Content>
|
</Content>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="Views\Shared\_Header.cshtml" />
|
<Content Include="Views\Home\Header.cshtml" />
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Content Include="Views\Shared\Left.cshtml" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="Views\Home\Index.cshtml">
|
<Content Include="Views\Home\Index.cshtml">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Content>
|
</Content>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Include="Views\Menu\LeftMenu.cshtml" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="Views\Account\Login.cshtml" />
|
||||||
|
</ItemGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
||||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||||
|
@ -57,7 +57,7 @@
|
|||||||
</label>
|
</label>
|
||||||
<button id="btnLogin" type="button" data-loading-text="loading" onclick="Login();" class="span4 btn btn-small btn-primary"><i class="icon-key"></i> Login</button>
|
<button id="btnLogin" type="button" data-loading-text="loading" onclick="Login();" class="span4 btn btn-small btn-primary"><i class="icon-key"></i> Login</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
</form>
|
||||||
@ -68,14 +68,13 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div><!--/span-->
|
</div><!--/span-->
|
||||||
</div><!--/row-->
|
</div><!--/row-->
|
||||||
</div>
|
</div>
|
||||||
</div><!--/.fluid-container-->
|
</div><!--/.fluid-container-->
|
||||||
<!-- basic scripts -->
|
<!-- basic scripts -->
|
||||||
|
|
||||||
<!-- page specific plugin scripts -->
|
<!-- page specific plugin scripts -->
|
||||||
<!-- inline scripts related to this page -->
|
<!-- inline scripts related to this page -->
|
||||||
|
|
||||||
@ -87,12 +86,12 @@
|
|||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: "/Home/Login",
|
url: "/Account/Login",
|
||||||
data: {
|
data: {
|
||||||
username: username,
|
username: username,
|
||||||
password: password
|
password: password
|
||||||
},
|
},
|
||||||
success: function(rel) {
|
success: function (rel) {
|
||||||
if (rel.Success)
|
if (rel.Success)
|
||||||
window.location = "/Home/Index";
|
window.location = "/Home/Index";
|
||||||
else {
|
else {
|
||||||
@ -106,7 +105,7 @@
|
|||||||
'</div>');
|
'</div>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
89
OpenAuth.Web/Views/Home/Header.cshtml
Normal file
89
OpenAuth.Web/Views/Home/Header.cshtml
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
@using OpenAuth.App
|
||||||
|
<div class="navbar navbar-inverse">
|
||||||
|
<div class="navbar-inner">
|
||||||
|
<div class="container-fluid">
|
||||||
|
<a class="brand" href="#"><small><i class="icon-leaf"></i> Ace Admin</small> </a>
|
||||||
|
<ul class="nav ace-nav pull-right">
|
||||||
|
<li class="green">
|
||||||
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
||||||
|
<i class="icon-envelope-alt icon-animated-vertical icon-only"></i>
|
||||||
|
<span class="badge badge-success">5</span>
|
||||||
|
</a>
|
||||||
|
<ul class="pull-right dropdown-navbar dropdown-menu dropdown-caret dropdown-closer">
|
||||||
|
<li class="nav-header">
|
||||||
|
<i class="icon-envelope"></i> 5 Messages
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="#">
|
||||||
|
<img alt="Alex's Avatar" class="msg-photo" src="avatars/avatar.png" />
|
||||||
|
<span class="msg-body">
|
||||||
|
<span class="msg-title">
|
||||||
|
<span class="blue">Alex:</span>
|
||||||
|
Ciao sociis natoque penatibus et auctor ...
|
||||||
|
</span>
|
||||||
|
<span class="msg-time">
|
||||||
|
<i class="icon-time"></i> <span>a moment ago</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="#">
|
||||||
|
<img alt="Susan's Avatar" class="msg-photo" src="avatars/avatar3.png" />
|
||||||
|
<span class="msg-body">
|
||||||
|
<span class="msg-title">
|
||||||
|
<span class="blue">Susan:</span>
|
||||||
|
Vestibulum id ligula porta felis euismod ...
|
||||||
|
</span>
|
||||||
|
<span class="msg-time">
|
||||||
|
<i class="icon-time"></i> <span>20 minutes ago</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="#">
|
||||||
|
<img alt="Bob's Avatar" class="msg-photo" src="avatars/avatar4.png" />
|
||||||
|
<span class="msg-body">
|
||||||
|
<span class="msg-title">
|
||||||
|
<span class="blue">Bob:</span>
|
||||||
|
Nullam quis risus eget urna mollis ornare ...
|
||||||
|
</span>
|
||||||
|
<span class="msg-time">
|
||||||
|
<i class="icon-time"></i> <span>3:15 pm</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="#">
|
||||||
|
See all messages
|
||||||
|
<i class="icon-arrow-right"></i>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li class="light-blue user-profile">
|
||||||
|
<a class="user-menu dropdown-toggle" href="#" data-toggle="dropdown">
|
||||||
|
<img alt="Jason's Photo" src="~/Content/avatars/user.jpg" class="nav-user-photo" />
|
||||||
|
<span id="user_info">
|
||||||
|
<small>Welcome,</small> @LoginCacheApp.GetLogin().UserName
|
||||||
|
</span>
|
||||||
|
<i class="icon-caret-down"></i>
|
||||||
|
</a>
|
||||||
|
<ul id="user_menu" class="pull-right dropdown-menu dropdown-yellow dropdown-caret dropdown-closer">
|
||||||
|
<li><a href="#"><i class="icon-cog"></i> Settings</a></li>
|
||||||
|
<li><a href="#"><i class="icon-user"></i> Profile</a></li>
|
||||||
|
<li class="divider"></li>
|
||||||
|
<li><a href="#"><i class="icon-off"></i> Logout</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul><!--/.ace-nav-->
|
||||||
|
</div><!--/.container-fluid-->
|
||||||
|
</div><!--/.navbar-inner-->
|
||||||
|
</div><!--/.navbar-->
|
@ -2,11 +2,13 @@
|
|||||||
Layout = "~/Views/Shared/_Layout.cshtml";
|
Layout = "~/Views/Shared/_Layout.cshtml";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RenderPage("~/Views/Shared/_Header.cshtml")
|
@RenderPage("~/Views/Home/Header.cshtml")
|
||||||
<div class="container-fluid" id="main-container">
|
<div class="container-fluid" id="main-container">
|
||||||
<a href="#" id="menu-toggler"><span></span></a><!-- menu toggler -->
|
<a href="#" id="menu-toggler"><span></span></a><!-- menu toggler -->
|
||||||
@RenderPage("~/Views/Shared/Left.cshtml")
|
@{
|
||||||
<div id="main-content" class="clearfix">
|
Html.RenderAction("LeftMenu","Menu");
|
||||||
|
}
|
||||||
|
<div id="main-content" class="clearfix">
|
||||||
|
|
||||||
<div id="breadcrumbs">
|
<div id="breadcrumbs">
|
||||||
|
|
||||||
@ -14,7 +16,6 @@
|
|||||||
|
|
||||||
<li><i class="icon-home"></i> <a href="#">Home</a><span class="divider"><i class="icon-angle-right"></i></span></li>
|
<li><i class="icon-home"></i> <a href="#">Home</a><span class="divider"><i class="icon-angle-right"></i></span></li>
|
||||||
|
|
||||||
<li class="active">Dashboard</li>
|
|
||||||
</ul><!--.breadcrumb-->
|
</ul><!--.breadcrumb-->
|
||||||
|
|
||||||
</div><!--#breadcrumbs-->
|
</div><!--#breadcrumbs-->
|
||||||
|
48
OpenAuth.Web/Views/Menu/LeftMenu.cshtml
Normal file
48
OpenAuth.Web/Views/Menu/LeftMenu.cshtml
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
@model OpenAuth.App.DTO.MenuForUserResponse
|
||||||
|
<div id="sidebar">
|
||||||
|
<div id="sidebar-shortcuts">
|
||||||
|
<div id="sidebar-shortcuts-large">
|
||||||
|
<button class="btn btn-small btn-success"><i class="icon-signal"></i></button>
|
||||||
|
<button class="btn btn-small btn-info"><i class="icon-pencil"></i></button>
|
||||||
|
<button class="btn btn-small btn-warning"><i class="icon-group"></i></button>
|
||||||
|
<button class="btn btn-small btn-danger"><i class="icon-cogs"></i></button>
|
||||||
|
</div>
|
||||||
|
<div id="sidebar-shortcuts-mini">
|
||||||
|
<span class="btn btn-success"></span>
|
||||||
|
<span class="btn btn-info"></span>
|
||||||
|
<span class="btn btn-warning"></span>
|
||||||
|
<span class="btn btn-danger"></span>
|
||||||
|
</div>
|
||||||
|
</div><!-- #sidebar-shortcuts -->
|
||||||
|
|
||||||
|
<ul class="nav nav-list">
|
||||||
|
|
||||||
|
@foreach (var menu in Model.Menus)
|
||||||
|
{
|
||||||
|
<li>
|
||||||
|
<a href="@menu.NavigateUrl">
|
||||||
|
<i class="icon-dashboard"></i>
|
||||||
|
<span>@menu.FullName</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
}
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="#" class="dropdown-toggle">
|
||||||
|
<i class="icon-file"></i>
|
||||||
|
<span>Other Pages</span>
|
||||||
|
<b class="arrow icon-angle-down"></b>
|
||||||
|
</a>
|
||||||
|
<ul class="submenu">
|
||||||
|
<li><a href="pricing.html"><i class="icon-double-angle-right"></i> Pricing Tables</a></li>
|
||||||
|
<li><a href="invoice.html"><i class="icon-double-angle-right"></i> Invoice</a></li>
|
||||||
|
<li><a href="login.html"><i class="icon-double-angle-right"></i> Login & Register</a></li>
|
||||||
|
<li><a href="error-404.html"><i class="icon-double-angle-right"></i> Error 404</a></li>
|
||||||
|
<li><a href="error-500.html"><i class="icon-double-angle-right"></i> Error 500</a></li>
|
||||||
|
<li><a href="blank.html"><i class="icon-double-angle-right"></i> Blank Page</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul><!--/.nav-list-->
|
||||||
|
|
||||||
|
<div id="sidebar-collapse"><i class="icon-double-angle-left"></i></div>
|
||||||
|
</div><!--/#sidebar-->
|
@ -1,232 +0,0 @@
|
|||||||
<div id="sidebar">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div id="sidebar-shortcuts">
|
|
||||||
|
|
||||||
<div id="sidebar-shortcuts-large">
|
|
||||||
|
|
||||||
<button class="btn btn-small btn-success"><i class="icon-signal"></i></button>
|
|
||||||
|
|
||||||
<button class="btn btn-small btn-info"><i class="icon-pencil"></i></button>
|
|
||||||
|
|
||||||
<button class="btn btn-small btn-warning"><i class="icon-group"></i></button>
|
|
||||||
|
|
||||||
<button class="btn btn-small btn-danger"><i class="icon-cogs"></i></button>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="sidebar-shortcuts-mini">
|
|
||||||
|
|
||||||
<span class="btn btn-success"></span>
|
|
||||||
|
|
||||||
<span class="btn btn-info"></span>
|
|
||||||
|
|
||||||
<span class="btn btn-warning"></span>
|
|
||||||
|
|
||||||
<span class="btn btn-danger"></span>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div><!-- #sidebar-shortcuts -->
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="nav nav-list">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<li class="active">
|
|
||||||
|
|
||||||
<a href="index.html">
|
|
||||||
|
|
||||||
<i class="icon-dashboard"></i>
|
|
||||||
|
|
||||||
<span>Dashboard</span>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<li>
|
|
||||||
|
|
||||||
<a href="typography.html">
|
|
||||||
|
|
||||||
<i class="icon-text-width"></i>
|
|
||||||
|
|
||||||
<span>Typography</span>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<li>
|
|
||||||
|
|
||||||
<a href="#" class="dropdown-toggle">
|
|
||||||
|
|
||||||
<i class="icon-desktop"></i>
|
|
||||||
|
|
||||||
<span>UI Elements</span>
|
|
||||||
|
|
||||||
<b class="arrow icon-angle-down"></b>
|
|
||||||
|
|
||||||
</a>
|
|
||||||
<ul class="submenu">
|
|
||||||
<li><a href="elements.html"><i class="icon-double-angle-right"></i> Elements</a></li>
|
|
||||||
<li><a href="buttons.html"><i class="icon-double-angle-right"></i> Buttons & Icons</a></li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<li>
|
|
||||||
|
|
||||||
<a href="tables.html">
|
|
||||||
|
|
||||||
<i class="icon-list"></i>
|
|
||||||
|
|
||||||
<span>Tables</span>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<li>
|
|
||||||
|
|
||||||
<a href="#" class="dropdown-toggle">
|
|
||||||
|
|
||||||
<i class="icon-edit"></i>
|
|
||||||
|
|
||||||
<span>Forms</span>
|
|
||||||
|
|
||||||
<b class="arrow icon-angle-down"></b>
|
|
||||||
|
|
||||||
</a>
|
|
||||||
<ul class="submenu">
|
|
||||||
<li><a href="form-elements.html"><i class="icon-double-angle-right"></i> Form Elements</a></li>
|
|
||||||
<li><a href="form-wizard.html"><i class="icon-double-angle-right"></i> Wizard & Validation</a></li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<li>
|
|
||||||
|
|
||||||
<a href="widgets.html">
|
|
||||||
|
|
||||||
<i class="icon-list-alt"></i>
|
|
||||||
|
|
||||||
<span>Widgets</span>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<li>
|
|
||||||
|
|
||||||
<a href="calendar.html">
|
|
||||||
|
|
||||||
<i class="icon-calendar"></i>
|
|
||||||
|
|
||||||
<span>Calendar</span>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<li>
|
|
||||||
|
|
||||||
<a href="gallery.html">
|
|
||||||
|
|
||||||
<i class="icon-picture"></i>
|
|
||||||
|
|
||||||
<span>Gallery</span>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<li>
|
|
||||||
|
|
||||||
<a href="grid.html">
|
|
||||||
|
|
||||||
<i class="icon-th"></i>
|
|
||||||
|
|
||||||
<span>Grid</span>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<li>
|
|
||||||
|
|
||||||
<a href="#" class="dropdown-toggle">
|
|
||||||
|
|
||||||
<i class="icon-file"></i>
|
|
||||||
|
|
||||||
<span>Other Pages</span>
|
|
||||||
|
|
||||||
<b class="arrow icon-angle-down"></b>
|
|
||||||
|
|
||||||
</a>
|
|
||||||
<ul class="submenu">
|
|
||||||
<li><a href="pricing.html"><i class="icon-double-angle-right"></i> Pricing Tables</a></li>
|
|
||||||
<li><a href="invoice.html"><i class="icon-double-angle-right"></i> Invoice</a></li>
|
|
||||||
<li><a href="login.html"><i class="icon-double-angle-right"></i> Login & Register</a></li>
|
|
||||||
<li><a href="error-404.html"><i class="icon-double-angle-right"></i> Error 404</a></li>
|
|
||||||
<li><a href="error-500.html"><i class="icon-double-angle-right"></i> Error 500</a></li>
|
|
||||||
<li><a href="blank.html"><i class="icon-double-angle-right"></i> Blank Page</a></li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</ul><!--/.nav-list-->
|
|
||||||
|
|
||||||
|
|
||||||
<div id="sidebar-collapse"><i class="icon-double-angle-left"></i></div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div><!--/#sidebar-->
|
|
@ -1,197 +0,0 @@
|
|||||||
<div class="navbar navbar-inverse">
|
|
||||||
<div class="navbar-inner">
|
|
||||||
<div class="container-fluid">
|
|
||||||
<a class="brand" href="#"><small><i class="icon-leaf"></i> Ace Admin</small> </a>
|
|
||||||
<ul class="nav ace-nav pull-right">
|
|
||||||
<li class="grey">
|
|
||||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
|
||||||
<i class="icon-tasks"></i>
|
|
||||||
<span class="badge">4</span>
|
|
||||||
</a>
|
|
||||||
<ul class="pull-right dropdown-navbar dropdown-menu dropdown-caret dropdown-closer">
|
|
||||||
<li class="nav-header">
|
|
||||||
<i class="icon-ok"></i> 4 Tasks to complete
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
<a href="#">
|
|
||||||
<div class="clearfix">
|
|
||||||
<span class="pull-left">Software Update</span>
|
|
||||||
<span class="pull-right">65%</span>
|
|
||||||
</div>
|
|
||||||
<div class="progress progress-mini"><div class="bar" style="width:65%"></div></div>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
<a href="#">
|
|
||||||
<div class="clearfix">
|
|
||||||
<span class="pull-left">Hardware Upgrade</span>
|
|
||||||
<span class="pull-right">35%</span>
|
|
||||||
</div>
|
|
||||||
<div class="progress progress-mini progress-danger"><div class="bar" style="width:35%"></div></div>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
<a href="#">
|
|
||||||
<div class="clearfix">
|
|
||||||
<span class="pull-left">Unit Testing</span>
|
|
||||||
<span class="pull-right">15%</span>
|
|
||||||
</div>
|
|
||||||
<div class="progress progress-mini progress-warning"><div class="bar" style="width:15%"></div></div>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
<a href="#">
|
|
||||||
<div class="clearfix">
|
|
||||||
<span class="pull-left">Bug Fixes</span>
|
|
||||||
<span class="pull-right">90%</span>
|
|
||||||
</div>
|
|
||||||
<div class="progress progress-mini progress-success progress-striped active"><div class="bar" style="width:90%"></div></div>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
<a href="#">
|
|
||||||
See tasks with details
|
|
||||||
<i class="icon-arrow-right"></i>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="purple">
|
|
||||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
|
||||||
<i class="icon-bell-alt icon-animated-bell icon-only"></i>
|
|
||||||
<span class="badge badge-important">8</span>
|
|
||||||
</a>
|
|
||||||
<ul class="pull-right dropdown-navbar navbar-pink dropdown-menu dropdown-caret dropdown-closer">
|
|
||||||
<li class="nav-header">
|
|
||||||
<i class="icon-warning-sign"></i> 8 Notifications
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
<a href="#">
|
|
||||||
<div class="clearfix">
|
|
||||||
<span class="pull-left"><i class="icon-comment btn btn-mini btn-pink"></i> New comments</span>
|
|
||||||
<span class="pull-right badge badge-info">+12</span>
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
<a href="#">
|
|
||||||
<i class="icon-user btn btn-mini btn-primary"></i> Bob just signed up as an editor ...
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
<a href="#">
|
|
||||||
<div class="clearfix">
|
|
||||||
<span class="pull-left"><i class="icon-shopping-cart btn btn-mini btn-success"></i> New orders</span>
|
|
||||||
<span class="pull-right badge badge-success">+8</span>
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
<a href="#">
|
|
||||||
<div class="clearfix">
|
|
||||||
<span class="pull-left"><i class="icon-twitter btn btn-mini btn-info"></i> Followers</span>
|
|
||||||
<span class="pull-right badge badge-info">+4</span>
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
<a href="#">
|
|
||||||
See all notifications
|
|
||||||
<i class="icon-arrow-right"></i>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="green">
|
|
||||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
|
||||||
<i class="icon-envelope-alt icon-animated-vertical icon-only"></i>
|
|
||||||
<span class="badge badge-success">5</span>
|
|
||||||
</a>
|
|
||||||
<ul class="pull-right dropdown-navbar dropdown-menu dropdown-caret dropdown-closer">
|
|
||||||
<li class="nav-header">
|
|
||||||
<i class="icon-envelope"></i> 5 Messages
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
<a href="#">
|
|
||||||
<img alt="Alex's Avatar" class="msg-photo" src="avatars/avatar.png" />
|
|
||||||
<span class="msg-body">
|
|
||||||
<span class="msg-title">
|
|
||||||
<span class="blue">Alex:</span>
|
|
||||||
Ciao sociis natoque penatibus et auctor ...
|
|
||||||
</span>
|
|
||||||
<span class="msg-time">
|
|
||||||
<i class="icon-time"></i> <span>a moment ago</span>
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
<a href="#">
|
|
||||||
<img alt="Susan's Avatar" class="msg-photo" src="avatars/avatar3.png" />
|
|
||||||
<span class="msg-body">
|
|
||||||
<span class="msg-title">
|
|
||||||
<span class="blue">Susan:</span>
|
|
||||||
Vestibulum id ligula porta felis euismod ...
|
|
||||||
</span>
|
|
||||||
<span class="msg-time">
|
|
||||||
<i class="icon-time"></i> <span>20 minutes ago</span>
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
<a href="#">
|
|
||||||
<img alt="Bob's Avatar" class="msg-photo" src="avatars/avatar4.png" />
|
|
||||||
<span class="msg-body">
|
|
||||||
<span class="msg-title">
|
|
||||||
<span class="blue">Bob:</span>
|
|
||||||
Nullam quis risus eget urna mollis ornare ...
|
|
||||||
</span>
|
|
||||||
<span class="msg-time">
|
|
||||||
<i class="icon-time"></i> <span>3:15 pm</span>
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
<a href="#">
|
|
||||||
See all messages
|
|
||||||
<i class="icon-arrow-right"></i>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="light-blue user-profile">
|
|
||||||
<a class="user-menu dropdown-toggle" href="#" data-toggle="dropdown">
|
|
||||||
<img alt="Jason's Photo" src="avatars/user.jpg" class="nav-user-photo" />
|
|
||||||
<span id="user_info">
|
|
||||||
<small>Welcome,</small> Jason
|
|
||||||
</span>
|
|
||||||
<i class="icon-caret-down"></i>
|
|
||||||
</a>
|
|
||||||
<ul id="user_menu" class="pull-right dropdown-menu dropdown-yellow dropdown-caret dropdown-closer">
|
|
||||||
<li><a href="#"><i class="icon-cog"></i> Settings</a></li>
|
|
||||||
<li><a href="#"><i class="icon-user"></i> Profile</a></li>
|
|
||||||
<li class="divider"></li>
|
|
||||||
<li><a href="#"><i class="icon-off"></i> Logout</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
</ul><!--/.ace-nav-->
|
|
||||||
</div><!--/.container-fluid-->
|
|
||||||
</div><!--/.navbar-inner-->
|
|
||||||
</div><!--/.navbar-->
|
|
@ -1,5 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
|
<package id="CommonServiceLocator" version="1.0" targetFramework="net40" />
|
||||||
<package id="Microsoft.AspNet.Mvc" version="4.0.30506.0" targetFramework="net40" />
|
<package id="Microsoft.AspNet.Mvc" version="4.0.30506.0" targetFramework="net40" />
|
||||||
<package id="Microsoft.AspNet.Mvc.FixedDisplayModes" version="1.0.0" targetFramework="net40" />
|
<package id="Microsoft.AspNet.Mvc.FixedDisplayModes" version="1.0.0" targetFramework="net40" />
|
||||||
<package id="Microsoft.AspNet.Mvc.zh-Hans" version="4.0.30506.0" targetFramework="net40" />
|
<package id="Microsoft.AspNet.Mvc.zh-Hans" version="4.0.30506.0" targetFramework="net40" />
|
||||||
@ -11,4 +12,5 @@
|
|||||||
<package id="Microsoft.Net.Http.zh-Hans" version="2.0.20710.0" targetFramework="net40" />
|
<package id="Microsoft.Net.Http.zh-Hans" version="2.0.20710.0" targetFramework="net40" />
|
||||||
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net40" />
|
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net40" />
|
||||||
<package id="Newtonsoft.Json" version="4.5.11" targetFramework="net40" />
|
<package id="Newtonsoft.Json" version="4.5.11" targetFramework="net40" />
|
||||||
|
<package id="Unity" version="2.1.505.2" targetFramework="net40" />
|
||||||
</packages>
|
</packages>
|
@ -60,4 +60,7 @@ Global
|
|||||||
{ADAE08C0-DE22-41F7-9F94-0E62AE327C25} = {EE008F5F-FD7F-407F-B201-6486BDE6B9F1}
|
{ADAE08C0-DE22-41F7-9F94-0E62AE327C25} = {EE008F5F-FD7F-407F-B201-6486BDE6B9F1}
|
||||||
{2E6B5B73-7757-43F0-8AC8-3030F7C191B8} = {C59DF46D-7815-462B-9FFF-750B2120B75B}
|
{2E6B5B73-7757-43F0-8AC8-3030F7C191B8} = {C59DF46D-7815-462B-9FFF-750B2120B75B}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
EnterpriseLibraryConfigurationToolBinariesPath = packages\Unity.2.1.505.2\lib\NET35
|
||||||
|
EndGlobalSection
|
||||||
EndGlobal
|
EndGlobal
|
||||||
|
Loading…
Reference in New Issue
Block a user