增加功能:权限细化到按钮 closed #ITIZG

https://gitee.com/LongbowEnterprise/BootstrapAdmin/issues/ITIZG?from=project-issue
comment: 通过Startup将MenuHelper静态方法AuthorizateButtons注入到IButtonAuthorization服务内,通过PermissionTagHelper监控asp-auth属性,通过IButtonAuthorization服务的Authorizate方法获得此按钮是否拥有权限
This commit is contained in:
Argo Zhang 2019-03-22 15:46:32 +08:00
parent 3c3e9ea5a1
commit 4eabb857b3
59 changed files with 2268 additions and 1456 deletions

View File

@ -13,11 +13,11 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Bootstrap.Security.Mvc" Version="2.2.3" />
<PackageReference Include="Bootstrap.Security.Mvc" Version="2.2.4" />
<PackageReference Include="Longbow.Logging" Version="2.2.5" />
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="3.1.2" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.2" PrivateAssets="All" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.3" PrivateAssets="All" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="4.0.1" />
</ItemGroup>

Binary file not shown.

View File

@ -1,4 +1,4 @@
using Bootstrap.DataAccess;
using Bootstrap.DataAccess;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
@ -16,16 +16,7 @@ namespace Bootstrap.Admin.Controllers.Api
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpPost("{id}")]
public IEnumerable<App> Post(string id) => AppHelper.RetrievesByRoleId(id);
/// <summary>
/// 保存应用程序授权
/// </summary>
/// <param name="id"></param>
/// <param name="appIds"></param>
/// <returns></returns>
[HttpPut("{id}")]
public bool Put(string id, [FromBody]IEnumerable<string> appIds) => AppHelper.SaveByRoleId(id, appIds);
[HttpGet("{id}")]
public IEnumerable<App> Get(string id) => AppHelper.RetrievesByRoleId(id);
}
}

View File

@ -1,4 +1,4 @@
using Bootstrap.Admin.Query;
using Bootstrap.Admin.Query;
using Bootstrap.DataAccess;
using Bootstrap.Security;
using Longbow.Web.Mvc;
@ -30,6 +30,7 @@ namespace Bootstrap.Admin.Controllers.Api
/// </summary>
/// <param name="value"></param>
[HttpPost]
[ButtonAuthorize(Url = "~/Admin/Dicts", Auth = "add,edit")]
public bool Post([FromBody]BootstrapDict value)
{
return DictHelper.Save(value);
@ -40,6 +41,7 @@ namespace Bootstrap.Admin.Controllers.Api
/// <param name="value"></param>
[HttpDelete]
[Authorize(Roles = "Administrators")]
[ButtonAuthorize(Url = "~/Admin/Dicts", Auth = "del")]
public bool Delete([FromBody]IEnumerable<string> value)
{
return DictHelper.Delete(value);

View File

@ -1,4 +1,4 @@
using Bootstrap.Admin.Query;
using Bootstrap.Admin.Query;
using Longbow.Web.Mvc;
using Microsoft.AspNetCore.Mvc;
using System;
@ -28,10 +28,11 @@ namespace Bootstrap.Admin.Controllers.Api
}
/// <summary>
///
/// 异常程序页面点击服务器日志按钮获取所有物理日志文件列表方法
/// </summary>
/// <returns></returns>
[HttpPost]
[ButtonAuthorize(Url = "~/Admin/Exceptions", Auth = "log")]
public IEnumerable<string> Post()
{
var filePath = Path.Combine(AppContext.BaseDirectory, "Error");
@ -43,10 +44,11 @@ namespace Bootstrap.Admin.Controllers.Api
}
/// <summary>
///
/// 选中指定文件查看其内容方法
/// </summary>
/// <returns></returns>
[HttpPut]
[ButtonAuthorize(Url = "~/Admin/Exceptions", Auth = "log")]
public JsonResult Put([FromBody]ExceptionFileQuery exceptionFile)
{
var filePath = Path.Combine(AppContext.BaseDirectory, "Error");
@ -66,7 +68,7 @@ namespace Bootstrap.Admin.Controllers.Api
else if (line.StartsWith("Exception Type: Longbow.Data.DBAccessException")) sb.AppendFormat("<div class='logDbExcep'>{0}</div>", line);
else if (line.StartsWith("StackTrace Information")) sb.AppendFormat("<b>{0}</b><br>", line);
else sb.AppendFormat("{0}<br>", line);
};
}
}
return new JsonResult(sb.ToString());
}

View File

@ -1,4 +1,4 @@
using Bootstrap.Admin.Query;
using Bootstrap.Admin.Query;
using Bootstrap.DataAccess;
using Longbow.Web.Mvc;
using Microsoft.AspNetCore.Mvc;
@ -41,6 +41,7 @@ namespace Bootstrap.Admin.Controllers.Api
/// </summary>
/// <param name="value"></param>
[HttpPost]
[ButtonAuthorize(Url = "~/Admin/Groups", Auth = "add,edit")]
public bool Post([FromBody]Group value)
{
return GroupHelper.Save(value);
@ -51,6 +52,7 @@ namespace Bootstrap.Admin.Controllers.Api
/// </summary>
/// <param name="value"></param>
[HttpDelete]
[ButtonAuthorize(Url = "~/Admin/Groups", Auth = "del")]
public bool Delete([FromBody]IEnumerable<string> value)
{
return GroupHelper.Delete(value);
@ -82,20 +84,21 @@ namespace Bootstrap.Admin.Controllers.Api
/// 保存部门授权
/// </summary>
/// <param name="id"></param>
/// <param name="groupIds"></param>
/// <param name="values"></param>
/// <param name="type"></param>
/// <returns></returns>
[HttpPut("{id}")]
public bool Put(string id, [FromBody]IEnumerable<string> groupIds, [FromQuery]string type)
[ButtonAuthorize(Url = "~/Admin/Groups", Auth = "assignUser,assignRole")]
public bool Put(string id, [FromBody]IEnumerable<string> values, [FromQuery]string type)
{
var ret = false;
switch (type)
{
case "user":
ret = GroupHelper.SaveByUserId(id, groupIds);
ret = UserHelper.SaveByGroupId(id, values);
break;
case "role":
ret = GroupHelper.SaveByRoleId(id, groupIds);
ret = RoleHelper.SaveByGroupId(id, values);
break;
}
return ret;

View File

@ -1,4 +1,4 @@
using Bootstrap.Admin.Query;
using Bootstrap.Admin.Query;
using Bootstrap.DataAccess;
using Bootstrap.Security;
using Longbow.Web.Mvc;
@ -30,6 +30,7 @@ namespace Bootstrap.Admin.Controllers.Api
/// </summary>
/// <param name="value"></param>
[HttpPost]
[ButtonAuthorize(Url = "~/Admin/Menus", Auth = "add,edit")]
public bool Post([FromBody]BootstrapMenu value)
{
return MenuHelper.Save(value);
@ -40,6 +41,7 @@ namespace Bootstrap.Admin.Controllers.Api
/// </summary>
/// <param name="value"></param>
[HttpDelete]
[ButtonAuthorize(Url = "~/Admin/Menus", Auth = "del")]
public bool Delete([FromBody]IEnumerable<string> value)
{
return MenuHelper.Delete(value);
@ -70,13 +72,14 @@ namespace Bootstrap.Admin.Controllers.Api
/// <summary>
/// 角色管理菜单授权保存按钮调用
/// </summary>
/// <param name="id">角色ID</param>
/// <param name="value">菜单ID集合</param>
/// <param name="id">菜单ID</param>
/// <param name="roleIds">角色ID集合</param>
/// <returns></returns>
[HttpPut("{id}")]
public bool Put(string id, [FromBody]IEnumerable<string> value)
[ButtonAuthorize(Url = "~/Admin/Menus", Auth = "assignRole")]
public bool Put(string id, [FromBody]IEnumerable<string> roleIds)
{
return MenuHelper.SaveMenusByRoleId(id, value);
return RoleHelper.SavaByMenuId(id, roleIds);
}
}
}

View File

@ -1,4 +1,4 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Concurrent;
@ -20,8 +20,8 @@ namespace Bootstrap.Admin.Controllers.Api
/// 获取所有在线用户数据
/// </summary>
/// <returns></returns>
[HttpPost()]
public IEnumerable<OnlineUser> Post([FromServices]IOnlineUsers onlineUSers)
[HttpGet()]
public IEnumerable<OnlineUser> Get([FromServices]IOnlineUsers onlineUSers)
{
return onlineUSers.OnlineUsers.OrderByDescending(u => u.LastAccessTime);
}

View File

@ -1,4 +1,4 @@
using Bootstrap.DataAccess;
using Bootstrap.DataAccess;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
@ -23,6 +23,7 @@ namespace Bootstrap.Admin.Controllers.Api
/// <param name="files">表单数据集合</param>
/// <returns></returns>
[HttpPost("{id}")]
[ButtonAuthorize(Url = "~/Admin/Profiles", Auth = "saveIcon")]
public JsonResult Post(string id, [FromServices]IHostingEnvironment env, [FromForm]DeleteFileCollection files)
{
if (!id.Equals("Delete", StringComparison.OrdinalIgnoreCase) || files.Key.Equals("default.jpg", StringComparison.OrdinalIgnoreCase)) return new JsonResult(new object());
@ -79,6 +80,7 @@ namespace Bootstrap.Admin.Controllers.Api
/// <param name="files"></param>
/// <returns></returns>
[HttpPost]
[ButtonAuthorize(Url = "~/Admin/Profiles", Auth = "saveIcon")]
public async Task<JsonResult> Post([FromServices]IHostingEnvironment env, IFormCollection files)
{
var previewUrl = string.Empty;
@ -114,5 +116,30 @@ namespace Bootstrap.Admin.Controllers.Api
append = false
});
}
/// <summary>
///
/// </summary>
/// <returns></returns>
[HttpPut]
[ButtonAuthorize(Url = "~/Admin/Profiles", Auth = "saveDisplayName,savePassword,saveApp,saveTheme")]
public bool Put([FromBody]User value)
{
var ret = false;
if (value.UserStatus == UserStates.ChangeTheme)
{
return UserHelper.SaveUserCssByName(value.UserName, value.Css);
}
if (value.UserName.Equals(User.Identity.Name, StringComparison.OrdinalIgnoreCase))
{
if (value.UserStatus == UserStates.ChangeDisplayName)
ret = UserHelper.SaveDisplayName(value.UserName, value.DisplayName);
else if (value.UserStatus == UserStates.ChangePassword)
ret = UserHelper.ChangePassword(value.UserName, value.Password, value.NewPassword);
else if (value.UserStatus == UserStates.SaveApp)
ret = UserHelper.SaveApp(value.UserName, value.App);
}
return ret;
}
}
}

View File

@ -1,4 +1,4 @@
using Bootstrap.Admin.Query;
using Bootstrap.Admin.Query;
using Bootstrap.DataAccess;
using Longbow.Web.Mvc;
using Microsoft.AspNetCore.Mvc;
@ -52,24 +52,28 @@ namespace Bootstrap.Admin.Controllers.Api
/// <summary>
/// 保存角色
/// </summary>
/// <param name="id">用户ID/部门ID/菜单ID</param>
/// <param name="roleIds">选中的角色ID集合</param>
/// <param name="id">角色ID</param>
/// <param name="values">选中的ID集合</param>
/// <param name="type">type=menu时菜单维护页面对角色授权弹框保存按钮调用</param>
/// <returns></returns>
[HttpPut("{id}")]
public bool Put(string id, [FromBody]IEnumerable<string> roleIds, [FromQuery]string type)
[ButtonAuthorize(Url = "~/Admin/Roles", Auth = "assignUser,assignGroup,assignMenu,assignApp")]
public bool Put(string id, [FromBody]IEnumerable<string> values, [FromQuery]string type)
{
var ret = false;
switch (type)
{
case "user":
ret = RoleHelper.SaveByUserId(id, roleIds);
ret = UserHelper.SaveByRoleId(id, values);
break;
case "group":
ret = RoleHelper.SaveByGroupId(id, roleIds);
ret = GroupHelper.SaveByRoleId(id, values);
break;
case "menu":
ret = RoleHelper.SavaByMenuId(id, roleIds);
ret = MenuHelper.SaveMenusByRoleId(id, values);
break;
case "app":
ret = AppHelper.SaveByRoleId(id, values);
break;
}
return ret;
@ -79,6 +83,7 @@ namespace Bootstrap.Admin.Controllers.Api
/// </summary>
/// <param name="value"></param>
[HttpPost]
[ButtonAuthorize(Url = "~/Admin/Roles", Auth = "add,edit")]
public bool Post([FromBody]Role value)
{
return RoleHelper.Save(value);
@ -88,6 +93,7 @@ namespace Bootstrap.Admin.Controllers.Api
/// </summary>
/// <param name="value"></param>
[HttpDelete]
[ButtonAuthorize(Url = "~/Admin/Roles", Auth = "del")]
public bool Delete([FromBody]IEnumerable<string> value)
{
return RoleHelper.Delete(value);

View File

@ -1,4 +1,4 @@
using Bootstrap.DataAccess;
using Bootstrap.DataAccess;
using Bootstrap.Security;
using Longbow.Cache;
using Microsoft.AspNetCore.Mvc;
@ -19,18 +19,13 @@ namespace Bootstrap.Admin.Controllers.Api
/// <param name="value"></param>
/// <returns></returns>
[HttpPost]
public bool Post([FromBody]BootstrapDict value)
{
//保存个性化设置
return DictHelper.SaveSettings(value);
}
[ButtonAuthorize(Url = "~/Admin/Settings", Auth = "saveTitle,saveFooter,saveTheme")]
public bool Post([FromBody]BootstrapDict value) => DictHelper.SaveSettings(value);
/// <summary>
///
/// </summary>
[HttpGet]
public IEnumerable<ICacheCorsItem> Get()
{
return CacheManager.CorsSites;
}
public IEnumerable<ICacheCorsItem> Get() => CacheManager.CorsSites;
}
}

View File

@ -1,4 +1,4 @@
using Bootstrap.Admin.Query;
using Bootstrap.Admin.Query;
using Bootstrap.DataAccess;
using Longbow.Web.Mvc;
using Microsoft.AspNetCore.Authorization;
@ -26,31 +26,7 @@ namespace Bootstrap.Admin.Controllers.Api
{
return value.RetrieveData();
}
/// <summary>
///
/// </summary>
/// <returns></returns>
[HttpPut]
public bool Put([FromBody]User value)
{
if (User.IsInRole("Administrators")) return false;
var ret = false;
if (value.UserStatus == UserStates.ChangeTheme)
{
return UserHelper.SaveUserCssByName(value.UserName, value.Css);
}
if (value.UserName.Equals(User.Identity.Name, StringComparison.OrdinalIgnoreCase))
{
if (value.UserStatus == UserStates.ChangeDisplayName)
ret = UserHelper.SaveDisplayName(value.UserName, value.DisplayName);
else if (value.UserStatus == UserStates.ChangePassword)
ret = UserHelper.ChangePassword(value.UserName, value.Password, value.NewPassword);
else if (value.UserStatus == UserStates.SaveApp)
ret = UserHelper.SaveApp(value.UserName, value.App);
}
return ret;
}
/// <summary>
///
/// </summary>
@ -81,11 +57,13 @@ namespace Bootstrap.Admin.Controllers.Api
}
return ret;
}
/// <summary>
/// 前台User View调用新建/更新用户
/// </summary>
/// <param name="value"></param>
[HttpPost]
[ButtonAuthorize(Url = "~/Admin/Users", Auth = "add,edit")]
public bool Post([FromBody]User value)
{
var ret = false;
@ -102,37 +80,42 @@ namespace Bootstrap.Admin.Controllers.Api
}
return ret;
}
/// <summary>
///
/// </summary>
/// <param name="id"></param>
/// <param name="userIds"></param>
/// <param name="values"></param>
/// <param name="type"></param>
/// <returns></returns>
[HttpPut("{id}")]
public bool Put(string id, [FromBody]IEnumerable<string> userIds, [FromQuery]string type)
[ButtonAuthorize(Url = "~/Admin/Users", Auth = "assignRole,assignGroup")]
public bool Put(string id, [FromBody]IEnumerable<string> values, [FromQuery]string type)
{
var ret = false;
switch (type)
{
case "role":
ret = UserHelper.SaveByRoleId(id, userIds);
ret = RoleHelper.SaveByUserId(id, values);
break;
case "group":
ret = UserHelper.SaveByGroupId(id, userIds);
ret = GroupHelper.SaveByUserId(id, values);
break;
}
return ret;
}
/// <summary>
///
/// </summary>
/// <param name="value"></param>
[HttpDelete]
[ButtonAuthorize(Url = "~/Admin/Users", Auth = "del")]
public bool Delete([FromBody]IEnumerable<string> value)
{
return UserHelper.Delete(value);
}
/// <summary>
///
/// </summary>

View File

@ -1,4 +1,4 @@
using Bootstrap.DataAccess;
using Bootstrap.DataAccess;
using Bootstrap.Security;
using Microsoft.AspNetCore.Mvc;
using System;
@ -22,10 +22,12 @@ namespace Bootstrap.Admin.Models
var authApps = AppHelper.RetrievesByUserName(controller.User.Identity.Name);
Applications = DictHelper.RetrieveApps().Where(app => app.Key == "0" || authApps.Any(key => key.Equals(app.Key, StringComparison.OrdinalIgnoreCase)));
}
/// <summary>
///
/// </summary>
public IEnumerable<BootstrapMenu> Navigations { get; private set; }
/// <summary>
///
/// </summary>

View File

@ -1,4 +1,4 @@
using Bootstrap.DataAccess;
using Bootstrap.DataAccess;
using Bootstrap.Security.Filter;
using Longbow.Web;
using Longbow.Web.SignalR;
@ -100,6 +100,7 @@ namespace Bootstrap.Admin
options.IncludeXmlComments(xmlPath);
options.OperationFilter<HttpHeaderOperation>(); // 添加httpHeader参数
});
services.AddButtonAuthorization(MenuHelper.AuthorizateButtons);
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.

View File

@ -1,4 +1,4 @@
@model NavigatorBarModel
@model NavigatorBarModel
@{
ViewBag.Title = "字典表维护";
Layout = "_Default";
@ -41,14 +41,6 @@
</div>
</form>
}
@section toolbar {
<div class="toolbar btn-group dropdown">
<button class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" type="button"><i class="fa fa-gear"></i></button>
<div class="dropdown-menu">
@await Html.PartialAsync("_ButtonBarGroup")
</div>
</div>
}
@section modal {
<div class="modal-header">
<h5 class="modal-title" id="myModalLabel">字典编辑窗口</h5>

View File

@ -1,4 +1,4 @@
@model NavigatorBarModel
@model NavigatorBarModel
@{
ViewBag.Title = "程序异常";
}
@ -68,14 +68,16 @@
</form>
</div>
</div>
<div id="toolbar" class="btn-group d-none">
<button id="btn_view" type="button" class="btn btn-danger">
<i class="fa fa-file-text-o" aria-hidden="true"></i><span>服务器日志</span>
</button>
<div class="toolbar btn-group dropdown">
<div id="toolbar" class="d-none">
<div class="toolbar btn-group">
<button id="btn_view" type="button" class="btn btn-danger" asp-auth="log">
<i class="fa fa-file-text-o" aria-hidden="true"></i><span>服务器日志</span>
</button>
</div>
<div class="gear btn-group dropdown">
<button class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" type="button"><i class="fa fa-gear"></i></button>
<div class="dropdown-menu">
<a id="tb_view" href="#" title="查看明细"><i class="fa fa-file-text-o"></i></a>
<a id="tb_view" href="#" title="查看明细" asp-auth="log"><i class="fa fa-file-text-o"></i></a>
</div>
</div>
</div>

View File

@ -1,4 +1,4 @@
@model NavigatorBarModel
@model NavigatorBarModel
@{
ViewBag.Title = "部门管理";
Layout = "_Default";
@ -24,20 +24,16 @@
</form>
}
@section toolbar {
<button id="btn_assignUser" type="button" class="btn btn-info">
<span class="fa fa-user" aria-hidden="true"></span><span>分配用户</span>
<button id="btn_assignUser" type="button" class="btn btn-info" asp-auth="assignUser">
<i class="fa fa-user" aria-hidden="true"></i><span>分配用户</span>
</button>
<button id="btn_assignRole" type="button" class="btn btn-warning">
<span class="fa fa-sitemap" aria-hidden="true"></span><span>分配角色</span>
<button id="btn_assignRole" type="button" class="btn btn-warning" asp-auth="assignRole">
<i class="fa fa-sitemap" aria-hidden="true"></i><span>分配角色</span>
</button>
<div class="toolbar btn-group">
<button class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" type="button"><i class="fa fa-gear"></i></button>
<div class="dropdown-menu">
@await Html.PartialAsync("_ButtonBarGroup")
<a id="tb_assignRole" href="#" title="分配角色"><i class="fa fa-sitemap"></i></a>
<a id="tb_assignUser" href="#" title="分配用户"><i class="fa fa-user"></i></a>
</div>
</div>
}
@section gear {
<a id="tb_assignUser" href="#" title="分配用户" asp-auth="assignUser"><i class="fa fa-user"></i></a>
<a id="tb_assignRole" href="#" title="分配角色" asp-auth="assignRole"><i class="fa fa-sitemap"></i></a>
}
@section modal {
<div class="modal-header">

View File

@ -60,6 +60,7 @@
<div class="dropdown-divider"></div>
<a href="#" data-val="0">菜单</a>
<a href="#" data-val="1">资源</a>
<a href="#" data-val="2">按钮</a>
</div>
</div>
</div>
@ -82,16 +83,12 @@
</form>
}
@section toolbar {
<button id="btn_assignRole" type="button" class="btn btn-info">
<span class="fa fa-sitemap" aria-hidden="true"></span><span>分配角色</span>
<button id="btn_assignRole" type="button" class="btn btn-info" asp-auth="assignRole">
<i class="fa fa-sitemap" aria-hidden="true"></i><span>分配角色</span>
</button>
<div class="toolbar btn-group">
<button class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" type="button"><i class="fa fa-gear"></i></button>
<div class="dropdown-menu">
@await Html.PartialAsync("_ButtonBarGroup")
<a id="tb_assignRole" href="#" title="分配角色"><i class="fa fa-sitemap"></i></a>
</div>
</div>
}
@section gear {
<a id="tb_assignRole" href="#" title="分配角色" asp-auth="assignRole"><i class="fa fa-sitemap"></i></a>
}
@section modal {
<div class="modal-header">
@ -178,6 +175,7 @@
<div class="dropdown-menu">
<a href="#" data-val="0">菜单</a>
<a href="#" data-val="1">资源</a>
<a href="#" data-val="2">按钮</a>
</div>
</div>
</div>

View File

@ -1,4 +1,4 @@
@model ProfilesModel
@model ProfilesModel
@{
ViewBag.Title = "个人中心";
}
@ -45,7 +45,7 @@
</div>
</div>
</form>
<div class="modal-footer d-none" data-admin="@User.IsInRole("Administrators")">
<div class="modal-footer" asp-auth="saveDisplayName">
<button id="btnSaveDisplayName" data-method="user" class="btn btn-secondary" type="button"><i class="fa fa-save"></i><span>保存</span></button>
</div>
</div>
@ -71,7 +71,7 @@
</div>
</div>
</form>
<div class="modal-footer d-none" data-admin="@User.IsInRole("Administrators")">
<div class="modal-footer" asp-auth="savePassword">
<button id="btnSavePassword" data-method="password" class="btn btn-secondary" type="button"><i class="fa fa-save"></i><span>保存</span></button>
</div>
</div>
@ -90,7 +90,7 @@
</div>
</div>
</div>
<div class="modal-footer d-none" data-admin="@User.IsInRole("Administrators")">
<div class="modal-footer" asp-auth="saveApp">
<button id="btnSaveApp" data-method="app" class="btn btn-secondary" type="button"><i class="fa fa-save"></i><span>保存</span></button>
</div>
</div>
@ -110,7 +110,7 @@
</div>
</div>
</div>
<div class="modal-footer d-none" data-admin="@User.IsInRole("Administrators")">
<div class="modal-footer" asp-auth="saveTheme">
<button id="btnSaveCss" data-method="css" class="btn btn-secondary" type="button"><i class="fa fa-save"></i><span>保存</span></button>
</div>
</div>
@ -118,7 +118,7 @@
<div class="card">
<div class="card-header">修改头像</div>
<div class="card-body">
<form enctype="multipart/form-data" class="d-none" data-admin="@User.IsInRole("Administrators")">
<form enctype="multipart/form-data" asp-auth="saveIcon">
<div class="form-group">
<input id="fileIcon" type="file" data-init="@Model.Size" data-file="@Model.FileName">
</div>

View File

@ -1,4 +1,4 @@
@model NavigatorBarModel
@model NavigatorBarModel
@{
ViewBag.Title = "角色管理";
Layout = "_Default";
@ -39,28 +39,24 @@
</form>
}
@section toolbar{
<button id="btn_assignUser" type="button" class="btn btn-info">
<span class="fa fa-user" aria-hidden="true"></span><span>分配用户</span>
<button id="btn_assignUser" type="button" class="btn btn-info" asp-auth="assignUser">
<i class="fa fa-user" aria-hidden="true"></i><span>分配用户</span>
</button>
<button id="btn_assignGroup" type="button" class="btn btn-warning">
<span class="fa fa-bank" aria-hidden="true"></span><span>分配部门</span>
<button id="btn_assignGroup" type="button" class="btn btn-warning" asp-auth="assignGroup">
<i class="fa fa-bank" aria-hidden="true"></i><span>分配部门</span>
</button>
<button id="btn_assignMenu" type="button" class="btn btn-secondary">
<span class="fa fa-dashboard" aria-hidden="true"></span><span>分配菜单</span>
<button id="btn_assignMenu" type="button" class="btn btn-secondary" asp-auth="assignMenu">
<i class="fa fa-dashboard" aria-hidden="true"></i><span>分配菜单</span>
</button>
<button id="btn_assignApp" type="button" class="btn btn-success">
<span class="fa fa-cubes" aria-hidden="true"></span><span>分配应用</span>
<button id="btn_assignApp" type="button" class="btn btn-success" asp-auth="assignApp">
<i class="fa fa-cubes" aria-hidden="true"></i><span>分配应用</span>
</button>
<div class="toolbar btn-group">
<button class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" type="button"><i class="fa fa-gear"></i></button>
<div class="dropdown-menu">
@await Html.PartialAsync("_ButtonBarGroup")
<a id="tb_assignUser" href="#" title="分配用户"><i class="fa fa-user"></i></a>
<a id="tb_assignGroup" href="#" title="分配部门"><i class="fa fa-bank"></i></a>
<a id="tb_assignMenu" href="#" title="分配菜单"><i class="fa fa-dashboard"></i></a>
<a id="tb_assignApp" href="#" title="分配应用"><i class="fa fa-cubes"></i></a>
</div>
</div>
}
@section gear {
<a id="tb_assignUser" href="#" title="分配用户" asp-auth="assignUser"><i class="fa fa-user"></i></a>
<a id="tb_assignGroup" href="#" title="分配部门" asp-auth="assignGroup"><i class="fa fa-bank"></i></a>
<a id="tb_assignMenu" href="#" title="分配菜单" asp-auth="assignMenu"><i class="fa fa-dashboard"></i></a>
<a id="tb_assignApp" href="#" title="分配应用" asp-auth="assignApp"><i class="fa fa-cubes"></i></a>
}
@section modal {
<div class="modal-header">

View File

@ -1,4 +1,4 @@
@model ThemeModel
@model ThemeModel
@{
ViewBag.Title = "网站设置";
}
@ -22,7 +22,7 @@
<div class="input-group">
<input type="text" class="form-control" id="sysName" placeholder="请输入网站标题50字以内" value="@Model.Title" maxlength="50" data-valid="true" />
<div class="input-group-append">
<button class="btn btn-secondary" type="button" data-method="title">保存</button>
<button class="btn btn-secondary" type="button" data-method="title" asp-auth="saveTitle">保存</button>
</div>
</div>
</div>
@ -35,7 +35,7 @@
<div class="input-group">
<input type="text" class="form-control" id="sysFoot" placeholder="请输入网站页脚50字以内" value="@Model.Footer" maxlength="50" data-valid="true" />
<div class="input-group-append">
<button class="btn btn-secondary" type="button" data-method="footer">保存</button>
<button class="btn btn-secondary" type="button" data-method="footer" asp-auth="saveFooter">保存</button>
</div>
</div>
</div>
@ -56,7 +56,7 @@
}
</div>
</div>
<button class="btn btn-secondary" type="button" data-method="css">保存</button>
<button class="btn btn-secondary" type="button" data-method="css" asp-auth="saveTheme">保存</button>
</div>
</div>
</div>
@ -65,7 +65,7 @@
<div class="card-header">
<div class="d-flex align-items-center">
<span class="flex-fill">网站缓存</span>
<a data-method="clear" href="#" class="fa fa-times-circle-o" data-admin="@User.IsInRole("Administrators")" title="全部清除" data-toggle="tooltip" data-placement="left"></a>
<a data-method="clear" href="#" class="fa fa-times-circle-o" title="全部清除" data-toggle="tooltip" data-placement="left" asp-auth="clearAllCache"></a>
<a data-method="refresh" href="#" class="fa fa-refresh ml-3" title="点击刷新" data-toggle="tooltip"></a>
</div>
</div>

View File

@ -1,4 +1,4 @@
@model NavigatorBarModel
@model NavigatorBarModel
@{
ViewBag.Title = "用户管理";
Layout = "_Default";
@ -24,20 +24,19 @@
</form>
}
@section toolbar {
<button id="btn_assignGroup" type="button" class="btn btn-info">
<span class="fa fa-bank" aria-hidden="true"></span><span>分配部门</span>
<button id="btn_assignGroup" type="button" class="btn btn-info" asp-auth="assignGroup">
<i class="fa fa-bank" aria-hidden="true"></i><span>分配部门</span>
</button>
<button id="btn_assignRole" type="button" class="btn btn-warning">
<span class="fa fa-sitemap" aria-hidden="true"></span><span>分配角色</span>
<button id="btn_assignRole" type="button" class="btn btn-warning" asp-auth="assignRole">
<i class="fa fa-sitemap" aria-hidden="true"></i><span>分配角色</span>
</button>
<div class="toolbar btn-group">
<button class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" type="button"><i class="fa fa-gear"></i></button>
<div class="dropdown-menu">
@await Html.PartialAsync("_ButtonBarGroup")
<a id="tb_assignRole" href="#" title="分配角色"><i class="fa fa-sitemap"></i></a>
<a id="tb_assignGroup" href="#" title="分配部门"><i class="fa fa-bank"></i></a>
</div>
</div>
}
@section gear {
<a id="tb_assignRole" href="#" title="分配角色"><i class="fa fa-sitemap" asp-auth="assignGroup"></i></a>
<a id="tb_assignGroup" href="#" title="分配部门"><i class="fa fa-bank" asp-auth="assignRole"></i></a>
}
@section tableButtons {
<button class="reset btn btn-warning" asp-auth="resetPassword"><i class="fa fa-remove"></i><span>重置</span></button>
}
@section modal {
<div class="modal-header">

View File

@ -1,4 +0,0 @@
<a id="tb_add" href="#" title="新增"><i class="fa fa-plus"></i></a>
<a id="tb_delete" href="#" title="删除"><i class="fa fa-remove"></i></a>
<a id="tb_edit" href="#" title="编辑"><i class="fa fa-pencil"></i></a>

View File

@ -1,4 +1,4 @@
@{
@{
Layout = "_Bootstrap";
}
@section css {
@ -18,6 +18,7 @@
}
@section javascript {
<environment include="Development">
<script src="~/lib/scrollbar/jquery.mousewheel.js"></script>
<script src="~/lib/scrollbar/jquery.mCustomScrollbar.js"></script>
<script src="~/lib/signalr/dist/browser/signalr.js"></script>
<script src="~/lib/dcjqaccordion/js/jquery.dcjqaccordion.2.7.js"></script>
@ -25,6 +26,7 @@
<script src="~/lib/nprogress/nprogress.js"></script>
</environment>
<environment exclude="Development">
<script src="~/lib/scrollbar/jquery.mousewheel.min.js"></script>
<script src="~/lib/scrollbar/jquery.mCustomScrollbar.concat.min.js"></script>
<script src="~/lib/signalr/dist/browser/signalr.min.js"></script>
<script src="~/lib/dcjqaccordion/js/jquery.dcjqaccordion.2.7.min.js"></script>

View File

@ -1,4 +1,5 @@
@{
@model NavigatorBarModel
@{
Layout = "_Admin";
}
@section css {
@ -57,11 +58,22 @@
@RenderSection("query", false)
</div>
</div>
<div id="toolbar" class="btn-group d-none">
<button id="btn_add" type="button" class="btn btn-success"><i class="fa fa-plus" aria-hidden="true"></i><span>新增</span></button>
<button id="btn_delete" type="button" class="btn btn-danger"><i class="fa fa-remove" aria-hidden="true"></i><span>删除</span></button>
<button id="btn_edit" type="button" class="btn btn-primary"><i class="fa fa-pencil" aria-hidden="true"></i><span>编辑</span></button>
@RenderSection("toolbar", false)
<div id="toolbar" class="d-none">
<div class="gear btn-group">
<button class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" type="button"><i class="fa fa-gear"></i></button>
<div class="dropdown-menu">
<a id="tb_add" href="#" title="新增" asp-auth="add"><i class="fa fa-plus"></i></a>
<a id="tb_delete" href="#" title="删除" asp-auth="del"><i class="fa fa-remove"></i></a>
<a id="tb_edit" href="#" title="编辑" asp-auth="edit"><i class="fa fa-pencil"></i></a>
@await RenderSectionAsync("gear", false)
</div>
</div>
<div class="toolbar btn-group">
<button id="btn_add" type="button" class="btn btn-success" asp-auth="add"><i class="fa fa-plus" aria-hidden="true"></i><span>新增</span></button>
<button id="btn_delete" type="button" class="btn btn-danger" asp-auth="del"><i class="fa fa-remove" aria-hidden="true"></i><span>删除</span></button>
<button id="btn_edit" type="button" class="btn btn-primary" asp-auth="edit"><i class="fa fa-pencil" aria-hidden="true"></i><span>编辑</span></button>
@RenderSection("toolbar", false)
</div>
</div>
<div class="card">
<div class="card-header">
@ -71,3 +83,10 @@
<table></table>
</div>
</div>
<div id="tableButtons" class="d-none">
<div class='btn-group'>
<button class='edit btn btn-sm btn-success' asp-auth="edit"><i class='fa fa-edit'></i><span>编辑</span></button>
<button class='del btn btn-sm btn-danger' asp-auth="del"><i class='fa fa-remove'></i><span>删除</span></button>
@RenderSection("tableButtons", false)
</div>
</div>

View File

@ -1,2 +1,3 @@
@using Bootstrap.Admin.Models
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@addTagHelper *, Bootstrap.Security.Mvc

View File

@ -11,6 +11,14 @@
white-space: nowrap;
margin-left: 10px;
}
.bootstrap-table .bs-bars .gear {
display: none;
}
.bootstrap-table .bs-bars .toolbar {
display: inline-flex;
}
}
@media (min-width: 667px) {

View File

@ -1,4 +1,4 @@
/*Title*/
/*Title*/
.header {
padding: 0 15px;
background: #fff;
@ -578,14 +578,36 @@ li[data-category="1"] .dd3-content .menuType {
margin-right: 4px;
}
.bootstrap-table .fa-info {
width: 9px;
}
.bootstrap-table .fixed-table-toolbar .bs-bars, .fixed-table-toolbar .search, .fixed-table-toolbar .columns {
line-height: normal;
}
.bootstrap-table .bs-bars .btn span:last-child {
display: none;
}
.bootstrap-table .fa-info {
width: 9px;
.bootstrap-table .bs-bars .toolbar {
display: none;
}
.bootstrap-table .bs-bars .gear .dropdown-menu a {
padding: 8px 12px;
display: table-cell;
color: #504d4d;
}
.bootstrap-table .bs-bars .gear .dropdown-menu a:not(:first-child) {
border-left: solid 1px #aeb2b7;
}
.bootstrap-table .bs-bars .gear .dropdown-menu a:hover {
color: #235e90;
}
pre {
padding: 5px;
margin: 5px;

View File

@ -1,4 +1,4 @@
@media (min-width: 375px) {
@media (min-width: 375px) {
.toolbar .dropdown-menu a {
padding: 0 14px;
}
@ -16,14 +16,6 @@
.sidebar-toggle-box span {
display: inline;
}
.toolbar {
display: none;
}
.bs-bars {
display: inline-block;
}
}
@media (min-width: 576px) {

View File

@ -1,4 +1,4 @@
html {
html {
font-size: 16px;
-ms-overflow-style: auto;
}
@ -178,36 +178,10 @@ footer {
color: #2A3542;
}
.bs-bars {
display: none;
}
.btn-fill {
width: 100%;
}
.toolbar {
position: relative;
margin-top: 10px;
margin-bottom: 10px;
line-height: 34px;
float: left;
}
.toolbar .dropdown-menu a {
padding: 0 12px;
display: table-cell;
color: #504d4d;
}
.toolbar .dropdown-menu a:not(:first-child) {
border-left: solid 1px #aeb2b7;
}
.toolbar .dropdown-menu a:hover {
color: #235e90;
}
.input-group .btn:focus, .btn-group .btn:focus, .page-link:focus {
box-shadow: none;
}
@ -365,10 +339,6 @@ input.pending {
border-top: none;
}
.fixed-table-toolbar .bs-bars, .fixed-table-toolbar .search, .fixed-table-toolbar .columns {
line-height: normal;
}
.table-condensed > thead > tr > th, .table-condensed > tfoot > tr > th, .table-condensed > tbody > tr > td {
padding: 2px 0;
}

View File

@ -1,12 +1,20 @@
(function ($) {
var formatCategoryName = function(menu) {
var ret = "";
if (menu.IsResource === 2) ret = "按钮";
else if (menu.IsResource === 1) ret = "资源";
else ret = menu.CategoryName;
return ret;
};
var cascadeMenu = function (menus) {
var html = "";
$.each(menus, function (index, menu) {
if (menu.Menus.length === 0) {
html += $.format('<li class="dd-item dd3-item" data-id="{0}" data-order="{4}" data-category="{3}"><div class="dd-handle dd3-handle"></div><div class="dd3-content"><div class="checkbox"><label><input type="checkbox" value="{0}"><span><i class="{1}"></i>{2}</span></label></div><div class="radio"><label><input type="radio" name="menu" value="{0}"><span><i class="{1}"></i>{2}</span></label></div><span class="menuType">{5}</span><span class="menuOrder">{4}</span></div></li>', menu.Id, menu.Icon, menu.Name, menu.Category, menu.Order, menu.CategoryName);
html += $.format('<li class="dd-item dd3-item" data-id="{0}" data-order="{4}" data-category="{3}"><div class="dd-handle dd3-handle"></div><div class="dd3-content"><div class="checkbox"><label><input type="checkbox" value="{0}"><span><i class="{1}"></i>{2}</span></label></div><div class="radio"><label><input type="radio" name="menu" value="{0}"><span><i class="{1}"></i>{2}</span></label></div><span class="menuType">{5}</span><span class="menuOrder">{4}</span></div></li>', menu.Id, menu.Icon, menu.Name, menu.Category, menu.Order, formatCategoryName(menu));
}
else {
html += $.format('<li class="dd-item dd3-item" data-id="{0}" data-order="{5}" data-category="{3}"><div class="dd-handle dd3-handle"></div><div class="dd3-content"><div class="checkbox"><label><input type="checkbox" value="{0}"><span><i class="{1}"></i>{2}</span></label></div><div class="radio"><label><input type="radio" name="menu" value="{0}"><span><i class="{1}"></i>{2}</span></label></div><span class="menuType">{6}</span><span class="menuOrder">{5}</span></div><ol class="dd-list">{4}</ol></li>', menu.Id, menu.Icon, menu.Name, menu.Category, cascadeSubMenu(menu.Menus), menu.Order, menu.CategoryName);
html += $.format('<li class="dd-item dd3-item" data-id="{0}" data-order="{5}" data-category="{3}"><div class="dd-handle dd3-handle"></div><div class="dd3-content"><div class="checkbox"><label><input type="checkbox" value="{0}"><span><i class="{1}"></i>{2}</span></label></div><div class="radio"><label><input type="radio" name="menu" value="{0}"><span><i class="{1}"></i>{2}</span></label></div><span class="menuType">{6}</span><span class="menuOrder">{5}</span></div><ol class="dd-list">{4}</ol></li>', menu.Id, menu.Icon, menu.Name, menu.Category, cascadeSubMenu(menu.Menus), menu.Order, formatCategoryName(menu));
}
});
return html;
@ -15,7 +23,7 @@
var cascadeSubMenu = function (menus) {
var html = "";
$.each(menus, function (index, menu) {
html += $.format('<li class="dd-item dd3-item" data-id="{0}" data-order="{4}" data-category="{3}"><div class="dd-handle dd3-handle"></div><div class="dd3-content"><div class="checkbox"><label><input type="checkbox" value="{0}"><span><i class="{1}"></i>{2}</span></label></div><div class="radio"><label><input type="radio" name="menu" value="{0}"><span><i class="{1}"></i>{2}</span></label></div><span class="menuType">{5}</span><span class="menuOrder">{4}</span></div></li>', menu.Id, menu.Icon, menu.Name, menu.Category, menu.Order, menu.CategoryName);
html += $.format('<li class="dd-item dd3-item" data-id="{0}" data-order="{4}" data-category="{3}"><div class="dd-handle dd3-handle"></div><div class="dd3-content"><div class="checkbox"><label><input type="checkbox" value="{0}"><span><i class="{1}"></i>{2}</span></label></div><div class="radio"><label><input type="radio" name="menu" value="{0}"><span><i class="{1}"></i>{2}</span></label></div><span class="menuType">{5}</span><span class="menuOrder">{4}</span></div></li>', menu.Id, menu.Icon, menu.Name, menu.Category, menu.Order, formatCategoryName(menu));
});
return html;
};
@ -187,70 +195,70 @@ $(function () {
});
// Apps
App = {
window.App = {
url: 'api/Apps',
title: "分配应用"
};
// Roles
Role = {
window.Role = {
url: 'api/Roles',
title: "分配角色"
};
// Users
User = {
window.User = {
url: 'api/Users',
title: "分配用户"
};
// Groups
Group = {
window.Group = {
url: 'api/Groups',
title: "分配部门"
};
// Menus
Menu = {
window.Menu = {
url: 'api/Menus',
iconView: 'Admin/IconView',
title: "分配菜单"
};
// Exceptions
Exceptions = {
window.Exceptions = {
url: 'api/Exceptions',
title: "程序异常日志"
};
// Dicts
Dicts = {
window.Dicts = {
url: 'api/Dicts'
};
// Profiles
Profiles = {
window.Profiles = {
url: 'api/Profiles',
del: 'api/Profiles/Delete'
};
// Settings
Settings = {
window.Settings = {
url: 'api/Settings'
};
// Messages
Messages = {
window.Messages = {
url: 'api/Messages'
};
// Tasks
Tasks = {
window.Tasks = {
url: 'api/Tasks'
};
// Notifications
Notifications = {
window.Notifications = {
url: 'api/Notifications'
};

View File

@ -21,7 +21,7 @@
],
exportOptions: {
fileName: "数据字典",
ignoreColumn: [0, 1]
ignoreColumn: [0, 5]
}
}
});

View File

@ -1,4 +1,4 @@
$(function () {
$(function () {
var $dialogUser = $("#dialogUser");
var $dialogUserHeader = $('#myUserModalLabel');
var $dialogUserForm = $('#userForm');
@ -52,14 +52,14 @@
var roleIds = $dialogRole.find('input:checked').map(function (index, element) {
return $(element).val();
}).toArray();
$.bc({ id: groupId, url: Role.url, method: "put", data: roleIds, query: { type: "group" }, title: Role.title, modal: '#dialogRole' });
$.bc({ id: groupId, url: Group.url, method: "put", data: roleIds, query: { type: "role" }, title: Role.title, modal: '#dialogRole' });
},
'#btnSubmitUser': function (row) {
var groupId = row.Id;
var userIds = $dialogUser.find(':checked').map(function (index, element) {
return $(element).val();
}).toArray();
$.bc({ id: groupId, url: User.url, method: "put", data: userIds, query: { type: "group" }, title: User.title, modal: '#dialogUser' });
$.bc({ id: groupId, url: Group.url, method: "put", data: userIds, query: { type: "user" }, title: User.title, modal: '#dialogUser' });
}
}
},
@ -72,7 +72,7 @@
],
exportOptions: {
fileName: "部门数据",
ignoreColumn: [0, 1]
ignoreColumn: [0, 3]
}
}
});

View File

@ -61,7 +61,7 @@ $(function () {
var roleIds = $dialogRole.find('input:checked').map(function (index, element) {
return $(element).val();
}).toArray();
$.bc({ id: menuId, url: Role.url, method: "put", data: roleIds, query: { type: "menu" }, title: Role.title, modal: '#dialogRole' });
$.bc({ id: menuId, url: Menu.url, method: "put", data: roleIds, title: Role.title, modal: '#dialogRole' });
}
},
callback: function (result) {
@ -72,11 +72,13 @@ $(function () {
}
},
smartTable: {
pageSize: 100,
pageList: [100, 200, 400],
sortName: 'Order',
queryParams: function (params) { return $.extend(params, { parentName: $('#txt_parent_menus_name').val(), name: $("#txt_menus_name").val(), category: $('#sel_menus_category').val(), isresource: $('#sel_menus_res').val(), appCode: $('#sel_app').val() }); }, //传递参数(*
exportOptions: {
fileName: "菜单数据",
ignoreColumn: [0, 1]
ignoreColumn: [0, 9]
},
columns: [
{
@ -125,7 +127,10 @@ $(function () {
},
{
title: "菜单类型", field: "IsResource", sortable: true, formatter: function (value, row, index) {
return value === "0" ? "菜单" : "资源";
var ret = "菜单";
if (value === "1") ret = "资源";
else if (value === "2") ret = "按钮";
return ret;
}
},
{
@ -151,7 +156,7 @@ $(function () {
},
onResetView: function () {
$table.treegrid({
treeColumn: 2,
treeColumn: 1,
expanderExpandedClass: 'fa fa-chevron-circle-down',
expanderCollapsedClass: 'fa fa-chevron-circle-down',
onChange: function () {
@ -253,7 +258,7 @@ $(function () {
case "order":
var data = $nestMenu.find('li:visible');
var mid = $('#menuID').val();
for (index in data) {
for (var index in data) {
var $data = $(data[index]);
if ($data.attr('data-id') === mid || $data.attr('data-id') === 0) {
if (index > 0) index--;

View File

@ -2,7 +2,7 @@ $(function () {
var apiUrl = "api/OnlineUsers";
var $table = $('table').smartTable({
url: apiUrl,
method: "post",
method: "get",
sidePagination: "client",
showToggle: false,
showRefresh: false,

View File

@ -1,4 +1,4 @@
$(function () {
$(function () {
var $headerIcon = $('#headerIcon');
var preIcon = $headerIcon.attr('src');
var $file = $('#fileIcon');
@ -78,12 +78,12 @@
switch ($this.attr('data-method')) {
case 'password':
data.UserStatus = 'ChangePassword';
$.bc({ url: User.url, method: "put", data: data, title: "更改密码" });
$.bc({ url: Profiles.url, method: "put", data: data, title: "更改密码" });
break;
case 'user':
data.UserStatus = 'ChangeDisplayName';
$.bc({
url: User.url, method: "put", data: data, title: "修改用户显示名称",
url: Profiles.url, method: "put", data: data, title: "修改用户显示名称",
callback: function (result) {
if (result) {
$('#userDisplayName').text(data.DisplayName);
@ -94,7 +94,7 @@
case 'css':
data.UserStatus = 'ChangeTheme';
$.bc({
url: User.url, method: "put", data: data, title: "保存样式", callback: function (result) {
url: Profiles.url, method: "put", data: data, title: "保存样式", callback: function (result) {
if (result) {
window.setTimeout(function () { window.location.reload(true); }, 1000);
}
@ -104,7 +104,7 @@
case 'app':
data.UserStatus = 'SaveApp';
$.bc({
url: User.url, method: "put", data: data, title: "保存应用", callback: function (result) {
url: Profiles.url, method: "put", data: data, title: "保存应用", callback: function (result) {
if (result) {
window.setTimeout(function () { window.location.reload(true); }, 1000);
}
@ -113,8 +113,7 @@
break;
}
});
$('[data-admin="False"]').removeClass('d-none');
if ($('[enctype="multipart/form-data"]').is(":hidden")) {
if ($('[enctype="multipart/form-data"]').length === 0) {
$('.card-img').removeClass('d-none');
}
$('#css').dropdown('val');

View File

@ -1,4 +1,4 @@
$(function () {
$(function () {
var $dialogUser = $("#dialogUser");
var $dialogUserHeader = $('#myUserModalLabel');
var $dialogUserForm = $('#userForm');
@ -76,7 +76,7 @@
},
'#btn_assignApp': function (row) {
$.bc({
id: row.Id, url: App.url, method: "post",
id: row.Id, url: App.url, method: "get",
callback: function (result) {
var htmlTemplate = this.htmlTemplate;
var html = $.map(result, function (element, index) {
@ -95,28 +95,28 @@
var userIds = $dialogUser.find(':checked').map(function (index, element) {
return $(element).val();
}).toArray();
$.bc({ id: roleId, url: User.url, method: "put", data: userIds, query: { type: "role" }, modal: '#dialogUser', title: User.title });
$.bc({ id: roleId, url: Role.url, method: "put", data: userIds, query: { type: "user" }, modal: '#dialogUser', title: User.title });
},
'#btnSubmitGroup': function (row) {
var roleId = row.Id;
var groupIds = $dialogGroup.find(':checked').map(function (index, element) {
return $(element).val();
}).toArray();
$.bc({ id: roleId, url: Group.url, method: "put", data: groupIds, query: { type: "role" }, modal: '#dialogGroup', title: Group.title });
$.bc({ id: roleId, url: Role.url, method: "put", data: groupIds, query: { type: "group" }, modal: '#dialogGroup', title: Group.title });
},
'#btnSubmitMenu': function (row) {
var roleId = row.Id;
var menuIds = $nestMenuInput.find('input:checkbox:checked').map(function (index, element) {
return $(element).val();
}).toArray();
$.bc({ id: roleId, url: Menu.url, method: "put", data: menuIds, modal: '#dialogMenu', title: Menu.title });
$.bc({ id: roleId, url: Role.url, method: "put", data: menuIds, query: { type: "menu" }, modal: '#dialogMenu', title: Menu.title });
},
'#btnSubmitApp': function (row) {
var roleId = row.Id;
var appIds = $dialogApp.find(':checked').map(function (index, element) {
return $(element).val();
}).toArray();
$.bc({ id: roleId, url: App.url, method: "put", data: appIds, modal: '#dialogApp', title: App.title });
$.bc({ id: roleId, url: Role.url, method: "put", data: appIds, query: { type: "app" }, modal: '#dialogApp', title: App.title });
}
}
},
@ -129,7 +129,7 @@
],
exportOptions: {
fileName: "角色数据",
ignoreColumn: [0, 1]
ignoreColumn: [0, 3]
}
}
});

View File

@ -1,6 +1,4 @@
$(function () {
$('a[data-admin="False"]').hide();
$(function () {
var dataBinder = new DataEntity({
Title: "#sysName",
Footer: "#sysFoot"

View File

@ -1,4 +1,4 @@
$(function () {
$(function () {
var $dialogRole = $('#dialogRole');
var $dialogRoleHeader = $('#myRoleModalLabel');
var $dialogRoleForm = $('#roleForm');
@ -58,14 +58,14 @@
var roleIds = $dialogRole.find(':checked').map(function (index, element) {
return $(element).val();
}).toArray();
$.bc({ id: userId, url: Role.url, method: 'put', data: roleIds, query: { type: "user" }, title: Role.title, modal: '#dialogRole' });
$.bc({ id: userId, url: User.url, method: 'put', data: roleIds, query: { type: "role" }, title: Role.title, modal: '#dialogRole' });
},
'#btnSubmitGroup': function (row) {
var userId = row.Id;
var groupIds = $dialogGroup.find(':checked').map(function (index, element) {
return $(element).val();
}).toArray();
$.bc({ id: userId, url: Group.url, method: 'put', data: groupIds, query: { type: "user" }, title: Group.title, modal: '#dialogGroup' });
$.bc({ id: userId, url: User.url, method: 'put', data: groupIds, query: { type: "group" }, title: Group.title, modal: '#dialogGroup' });
},
'#btnReset': function (row) {
$.bc({ id: row.UserName, url: 'api/Register', method: 'put', data: { password: $('#resetPassword').val() }, modal: "#dialogReset", title: "重置密码", callback: function (result) { if (result) $table.bootstrapTable('refresh'); } });
@ -93,34 +93,38 @@
{ title: "注册时间", field: "RegisterTime", sortable: true },
{ title: "授权时间", field: "ApprovedTime", sortable: true },
{ title: "授权人", field: "ApprovedBy", sortable: true },
{ title: "说明", field: "Description", sortable: false },
{
title: "操作", field: "IsReset", formatter: function (value, row, index) {
return value === 1 ? '<button class="reset btn btn-danger"><i class="fa fa-remove"></i><span>重置</span></button>' : '';
},
events: {
'click .reset': function (e, value, row, index) {
$table.bootstrapTable('uncheckAll');
$table.bootstrapTable('check', index);
$dialogResetHeader.text($.format("{0} - 重置密码窗口", row.UserName));
$.bc({
id: row.UserName, url: User.url, method: 'post', query: { type: "reset" }, callback: function (result) {
if ($.isArray(result)) {
var reason = result.map(function (v, index) {
return $.format("{0}: {1}", v.Key, v.Value);
}).join('\n');
$resetReason.text(reason);
$dialogReset.modal('show');
}
}
});
}
}
}
{ title: "说明", field: "Description", sortable: false }
],
editButtons: {
events : {
'click .reset': function (e, value, row, index) {
$table.bootstrapTable('uncheckAll');
$table.bootstrapTable('check', index);
$dialogResetHeader.text($.format("{0} - 重置密码窗口", row.UserName));
$.bc({
id: row.UserName, url: User.url, method: 'post', query: { type: "reset" }, callback: function (result) {
if ($.isArray(result)) {
var reason = result.map(function (v, index) {
return $.format("{0}: {1}", v.Key, v.Value);
}).join('\n');
$resetReason.text(reason);
$dialogReset.modal('show');
}
}
});
}
},
formatter: function (value, row, index) {
var $this = this.clone();
if (row.IsReset === 0) {
$this.find('button.reset').remove();
}
return $this.html();
}
},
exportOptions: {
fileName: "用户数据",
ignoreColumn: [0, 1]
ignoreColumn: [0, 7]
}
}
});

View File

@ -233,7 +233,7 @@
var base = $('#pathBase').attr('href');
return base + url;
},
safeHtml: function(text) {
safeHtml: function (text) {
return $('<div>').text(text).html();
},
syntaxHighlight: function (json) {
@ -281,20 +281,29 @@
lgbTable: function (options) {
var bsa = new DataTable($.extend(options.dataBinder, { url: options.url }));
var settings = $.extend({
var settings = $.extend(true, {
url: options.url,
checkbox: true,
edit: true,
editButtons: {
id: "#tableButtons",
events: {},
formatter: false
},
editTitle: "操作",
editField: "Id",
queryButton: false
}, options.smartTable);
if (settings.edit) settings.columns.unshift({
var $editButtons = $(settings.editButtons.id);
if ($editButtons.find('button').length > 0) settings.columns.push({
title: settings.editTitle,
field: settings.editField,
events: bsa.idEvents(),
events: $.extend({}, bsa.idEvents(), settings.editButtons.events),
formatter: function (value, row, index) {
return "<div class='btn-group'><button class='edit btn btn-sm btn-success'><i class='fa fa-edit'></i><span>编辑</span></button><button class='del btn btn-sm btn-danger'><i class='fa fa-remove'></i><span>删除</span></button></div>";
if ($.isFunction(settings.editButtons.formatter)) {
return settings.editButtons.formatter.call($editButtons, value, row, index);
}
return $editButtons.html();
}
});
if (settings.checkbox) settings.columns.unshift({ checkbox: true });
@ -337,17 +346,19 @@
}
else {
var formatter = value.formatter;
value.formatter = function(value, row, index, field) {
value.formatter = function (value, row, index, field) {
return formatter.call(this, $.safeHtml(value), row, index, field);
}
}
});
this.bootstrapTable(settings);
$('.bootstrap-table .fixed-table-toolbar .columns .export .dropdown-menu').addClass("dropdown-menu-right");
$(settings.toolbar).removeClass('d-none').find('.toolbar').on('click', 'a', function (e) {
var $gear = $(settings.toolbar).removeClass('d-none').find('.gear');
if ($gear.find('.dropdown-menu > a').length === 0) $gear.addClass('d-none');
$gear.on('click', 'a', function (e) {
e.preventDefault();
$('#' + $(this).attr('id').replace('tb_', 'btn_')).trigger("click");
}).insertBefore(this.parents('.bootstrap-table').find('.fixed-table-toolbar > .bs-bars'));
});
if (settings.queryButton) {
$(settings.queryButton).on('click', this, function (e) {
e.data.bootstrapTable('refresh');

View File

@ -0,0 +1,221 @@
/*!
* jQuery Mousewheel 3.1.13
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license
* http://jquery.org/license
*/
(function (factory) {
if ( typeof define === 'function' && define.amd ) {
// AMD. Register as an anonymous module.
define(['jquery'], factory);
} else if (typeof exports === 'object') {
// Node/CommonJS style for Browserify
module.exports = factory;
} else {
// Browser globals
factory(jQuery);
}
}(function ($) {
var toFix = ['wheel', 'mousewheel', 'DOMMouseScroll', 'MozMousePixelScroll'],
toBind = ( 'onwheel' in document || document.documentMode >= 9 ) ?
['wheel'] : ['mousewheel', 'DomMouseScroll', 'MozMousePixelScroll'],
slice = Array.prototype.slice,
nullLowestDeltaTimeout, lowestDelta;
if ( $.event.fixHooks ) {
for ( var i = toFix.length; i; ) {
$.event.fixHooks[ toFix[--i] ] = $.event.mouseHooks;
}
}
var special = $.event.special.mousewheel = {
version: '3.1.12',
setup: function() {
if ( this.addEventListener ) {
for ( var i = toBind.length; i; ) {
this.addEventListener( toBind[--i], handler, false );
}
} else {
this.onmousewheel = handler;
}
// Store the line height and page height for this particular element
$.data(this, 'mousewheel-line-height', special.getLineHeight(this));
$.data(this, 'mousewheel-page-height', special.getPageHeight(this));
},
teardown: function() {
if ( this.removeEventListener ) {
for ( var i = toBind.length; i; ) {
this.removeEventListener( toBind[--i], handler, false );
}
} else {
this.onmousewheel = null;
}
// Clean up the data we added to the element
$.removeData(this, 'mousewheel-line-height');
$.removeData(this, 'mousewheel-page-height');
},
getLineHeight: function(elem) {
var $elem = $(elem),
$parent = $elem['offsetParent' in $.fn ? 'offsetParent' : 'parent']();
if (!$parent.length) {
$parent = $('body');
}
return parseInt($parent.css('fontSize'), 10) || parseInt($elem.css('fontSize'), 10) || 16;
},
getPageHeight: function(elem) {
return $(elem).height();
},
settings: {
adjustOldDeltas: true, // see shouldAdjustOldDeltas() below
normalizeOffset: true // calls getBoundingClientRect for each event
}
};
$.fn.extend({
mousewheel: function(fn) {
return fn ? this.bind('mousewheel', fn) : this.trigger('mousewheel');
},
unmousewheel: function(fn) {
return this.unbind('mousewheel', fn);
}
});
function handler(event) {
var orgEvent = event || window.event,
args = slice.call(arguments, 1),
delta = 0,
deltaX = 0,
deltaY = 0,
absDelta = 0,
offsetX = 0,
offsetY = 0;
event = $.event.fix(orgEvent);
event.type = 'mousewheel';
// Old school scrollwheel delta
if ( 'detail' in orgEvent ) { deltaY = orgEvent.detail * -1; }
if ( 'wheelDelta' in orgEvent ) { deltaY = orgEvent.wheelDelta; }
if ( 'wheelDeltaY' in orgEvent ) { deltaY = orgEvent.wheelDeltaY; }
if ( 'wheelDeltaX' in orgEvent ) { deltaX = orgEvent.wheelDeltaX * -1; }
// Firefox < 17 horizontal scrolling related to DOMMouseScroll event
if ( 'axis' in orgEvent && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) {
deltaX = deltaY * -1;
deltaY = 0;
}
// Set delta to be deltaY or deltaX if deltaY is 0 for backwards compatabilitiy
delta = deltaY === 0 ? deltaX : deltaY;
// New school wheel delta (wheel event)
if ( 'deltaY' in orgEvent ) {
deltaY = orgEvent.deltaY * -1;
delta = deltaY;
}
if ( 'deltaX' in orgEvent ) {
deltaX = orgEvent.deltaX;
if ( deltaY === 0 ) { delta = deltaX * -1; }
}
// No change actually happened, no reason to go any further
if ( deltaY === 0 && deltaX === 0 ) { return; }
// Need to convert lines and pages to pixels if we aren't already in pixels
// There are three delta modes:
// * deltaMode 0 is by pixels, nothing to do
// * deltaMode 1 is by lines
// * deltaMode 2 is by pages
if ( orgEvent.deltaMode === 1 ) {
var lineHeight = $.data(this, 'mousewheel-line-height');
delta *= lineHeight;
deltaY *= lineHeight;
deltaX *= lineHeight;
} else if ( orgEvent.deltaMode === 2 ) {
var pageHeight = $.data(this, 'mousewheel-page-height');
delta *= pageHeight;
deltaY *= pageHeight;
deltaX *= pageHeight;
}
// Store lowest absolute delta to normalize the delta values
absDelta = Math.max( Math.abs(deltaY), Math.abs(deltaX) );
if ( !lowestDelta || absDelta < lowestDelta ) {
lowestDelta = absDelta;
// Adjust older deltas if necessary
if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) {
lowestDelta /= 40;
}
}
// Adjust older deltas if necessary
if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) {
// Divide all the things by 40!
delta /= 40;
deltaX /= 40;
deltaY /= 40;
}
// Get a whole, normalized value for the deltas
delta = Math[ delta >= 1 ? 'floor' : 'ceil' ](delta / lowestDelta);
deltaX = Math[ deltaX >= 1 ? 'floor' : 'ceil' ](deltaX / lowestDelta);
deltaY = Math[ deltaY >= 1 ? 'floor' : 'ceil' ](deltaY / lowestDelta);
// Normalise offsetX and offsetY properties
if ( special.settings.normalizeOffset && this.getBoundingClientRect ) {
var boundingRect = this.getBoundingClientRect();
offsetX = event.clientX - boundingRect.left;
offsetY = event.clientY - boundingRect.top;
}
// Add information to the event object
event.deltaX = deltaX;
event.deltaY = deltaY;
event.deltaFactor = lowestDelta;
event.offsetX = offsetX;
event.offsetY = offsetY;
// Go ahead and set deltaMode to 0 since we converted to pixels
// Although this is a little odd since we overwrite the deltaX/Y
// properties with normalized deltas.
event.deltaMode = 0;
// Add event and delta to the front of the arguments
args.unshift(event, delta, deltaX, deltaY);
// Clearout lowestDelta after sometime to better
// handle multiple device types that give different
// a different lowestDelta
// Ex: trackpad = 3 and mouse wheel = 120
if (nullLowestDeltaTimeout) { clearTimeout(nullLowestDeltaTimeout); }
nullLowestDeltaTimeout = setTimeout(nullLowestDelta, 200);
return ($.event.dispatch || $.event.handle).apply(this, args);
}
function nullLowestDelta() {
lowestDelta = null;
}
function shouldAdjustOldDeltas(orgEvent, absDelta) {
// If this is an older event and the delta is divisable by 120,
// then we are assuming that the browser is treating this as an
// older mouse wheel event and that we should divide the deltas
// by 40 to try and get a more usable deltaFactor.
// Side note, this actually impacts the reported scroll distance
// in older browsers and can cause scrolling to be slower than native.
// Turn this off by setting $.event.special.mousewheel.settings.adjustOldDeltas to false.
return special.settings.adjustOldDeltas && orgEvent.type === 'mousewheel' && absDelta % 120 === 0;
}
}));

View File

@ -0,0 +1,8 @@
/*!
* jQuery Mousewheel 3.1.13
*
* Copyright 2015 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*/
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})});

View File

@ -56,9 +56,7 @@ namespace Bootstrap.DataAccess
/// <summary>
/// 保存网站个性化设置
/// </summary>
/// <param name="name"></param>
/// <param name="code"></param>
/// <param name="category"></param>
/// <param name="dict"></param>
/// <returns></returns>
public static bool SaveSettings(BootstrapDict dict)
{

View File

@ -1,7 +1,9 @@
using Bootstrap.Security;
using Bootstrap.Security;
using Bootstrap.Security.DataAccess;
using Longbow.Cache;
using Longbow.Data;
using Microsoft.AspNetCore.Http;
using System;
using System.Collections.Generic;
using System.Linq;
@ -99,6 +101,26 @@ namespace Bootstrap.DataAccess
return DbHelper.CascadeMenus(menus, activeUrl);
}
/// <summary>
/// 通过当前用户名与指定菜单路径获取此菜单下所有授权按钮集合
/// </summary>
/// <param name="context">请求上下文</param>
/// <param name="url">资源按钮所属菜单</param>
/// <param name="key">资源授权码</param>
/// <returns></returns>
public static bool AuthorizateButtons(HttpContext context, string url, string key)
{
if (context.User.IsInRole("Administrators")) return true;
var menus = RetrieveAllMenus(context.User.Identity.Name);
var activeMenu = menus.FirstOrDefault(m => m.Url.Equals(url, StringComparison.OrdinalIgnoreCase));
if (activeMenu == null) return false;
var authorKeys = menus.Where(m => m.ParentId == activeMenu.Id && m.IsResource == 2).Select(m => m.Url);
var keys = key.SpanSplitAny(",. ;", StringSplitOptions.RemoveEmptyEntries);
return keys.Any(m => authorKeys.Any(k => k == m));
}
/// <summary>
/// 通过当前用户名获得所有菜单,层次化后集合
/// </summary>

View File

@ -43,30 +43,65 @@ INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'系统设
INSERT [dbo].[Dicts] ([Category], [Name], [Code], [Define]) VALUES (N'系统设置', N'获取IP地点', '0', 0)
DELETE FROM Navigations
SET IDENTITY_INSERT [dbo].[Navigations] ON
INSERT [dbo].[Navigations] ([ID], [ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (1, 0, N'后台管理', 10, N'fa fa-gear', N'~/Admin/Index', N'0')
INSERT [dbo].[Navigations] ([ID], [ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (2, 0, N'个人中心', 20, N'fa fa-suitcase', N'~/Admin/Profiles', N'0')
INSERT [dbo].[Navigations] ([ID], [ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (3, 0, N'返回前台', 30, N'fa fa-hand-o-left', N'~/Home/Index', N'0')
INSERT [dbo].[Navigations] ([ID], [ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (4, 0, N'网站设置', 40, N'fa fa-fa', N'~/Admin/Settings', N'0')
INSERT [dbo].[Navigations] ([ID], [ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (5, 0, N'菜单管理', 50, N'fa fa-dashboard', N'~/Admin/Menus', N'0')
INSERT [dbo].[Navigations] ([ID], [ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (6, 0, N'用户管理', 60, N'fa fa-user', N'~/Admin/Users', N'0')
INSERT [dbo].[Navigations] ([ID], [ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (7, 0, N'角色管理', 70, N'fa fa-sitemap', N'~/Admin/Roles', N'0')
INSERT [dbo].[Navigations] ([ID], [ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (8, 0, N'部门管理', 80, N'fa fa-bank', N'~/Admin/Groups', N'0')
INSERT [dbo].[Navigations] ([ID], [ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (9, 0, N'字典表维护', 90, N'fa fa-book', N'~/Admin/Dicts', N'0')
INSERT [dbo].[Navigations] ([ID], [ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (10, 0, N'站内消息', 100, N'fa fa-envelope', N'~/Admin/Messages', N'0')
INSERT [dbo].[Navigations] ([ID], [ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (11, 0, N'任务管理', 110, N'fa fa fa-tasks', N'~/Admin/Tasks', N'0')
INSERT [dbo].[Navigations] ([ID], [ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (12, 0, N'通知管理', 120, N'fa fa-bell', N'~/Admin/Notifications', N'0')
INSERT [dbo].[Navigations] ([ID], [ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (13, 0, N'日志管理', 130, N'fa fa-gears', N'#', N'0')
INSERT [dbo].[Navigations] ([ID], [ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (20, 13, N'操作日志', 10, N'fa fa-edit', N'~/Admin/Logs', N'0')
INSERT [dbo].[Navigations] ([ID], [ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (21, 13, N'登录日志', 20, N'fa fa-user-circle-o', N'~/Admin/Logins', N'0')
INSERT [dbo].[Navigations] ([ID], [ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (22, 13, N'访问日志', 30, N'fa fa-bars', N'~/Admin/Traces', N'0')
INSERT [dbo].[Navigations] ([ID], [ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (14, 0, N'在线用户', 140, N'fa fa-users', N'~/Admin/Online', N'0')
INSERT [dbo].[Navigations] ([ID], [ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (15, 0, N'程序异常', 150, N'fa fa-cubes', N'~/Admin/Exceptions', N'0')
INSERT [dbo].[Navigations] ([ID], [ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (16, 0, N'工具集合', 160, N'fa fa-gavel', N'#', N'0')
INSERT [dbo].[Navigations] ([ID], [ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (17, 16, N'客户端测试', 10, N'fa fa-wrench', N'~/Admin/Mobile', N'0')
INSERT [dbo].[Navigations] ([ID], [ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (18, 16, N'API文档', 10, N'fa fa-wrench', N'~/swagger', N'0')
INSERT [dbo].[Navigations] ([ID], [ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (19, 16, N'图标集', 10, N'fa fa-dashboard', N'~/Admin/FAIcon', N'0')
SET IDENTITY_INSERT [dbo].[Navigations] OFF
DBCC CHECKIDENT(Navigations, RESEED, 0)
INSERT [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, N'后台管理', 10, N'fa fa-gear', N'~/Admin/Index', N'0')
INSERT [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, N'个人中心', 20, N'fa fa-suitcase', N'~/Admin/Profiles', N'0')
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (@@Identity, N'保存显示名称', 10, 'fa fa-fa', 'saveDisplayName', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (@@Identity - 1, N'保存密码', 20, 'fa fa-fa', 'savePassword', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (@@Identity - 2, N'保存应用', 30, 'fa fa-fa', 'saveApp', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (@@Identity - 3, N'保存样式', 40, 'fa fa-fa', 'saveTheme', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (@@Identity - 4, N'保存头像', 50, 'fa fa-fa', 'saveIcon', '0', 2);
INSERT [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, N'返回前台', 30, N'fa fa-hand-o-left', N'~/Home/Index', N'0')
INSERT [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, N'网站设置', 40, N'fa fa-fa', N'~/Admin/Settings', N'0')
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (@@Identity, N'保存系统名称', 10, 'fa fa-fa', 'saveTitle', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (@@Identity - 1, N'保存页脚设置', 20, 'fa fa-fa', 'saveFooter', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (@@Identity - 2, N'保存样式', 30, 'fa fa-fa', 'saveTheme', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (@@Identity - 3, N'清理缓存', 40, 'fa fa-fa', 'clearCache', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (@@Identity - 4, N'清理全部缓存', 50, 'fa fa-fa', 'clearAllCache', '0', 2);
INSERT [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, N'菜单管理', 50, N'fa fa-dashboard', N'~/Admin/Menus', N'0')
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (@@Identity, N'新增', 10, 'fa fa-fa', 'add', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (@@Identity - 1, N'编辑', 20, 'fa fa-fa', 'edit', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (@@Identity - 2, N'删除', 30, 'fa fa-fa', 'del', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (@@Identity - 3, N'分配角色', 40, 'fa fa-fa', 'assignRole', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (0, N'图标页面', 50, 'fa fa-fa', '~/Admin/IconView', '0', 1);
INSERT [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, N'用户管理', 60, N'fa fa-user', N'~/Admin/Users', N'0')
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (@@Identity, N'新增', 10, 'fa fa-fa', 'add', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (@@Identity - 1, N'编辑', 20, 'fa fa-fa', 'edit', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (@@Identity - 2, N'删除', 30, 'fa fa-fa', 'del', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (@@Identity - 3, N'分配部门', 40, 'fa fa-fa', 'assignGroup', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (@@Identity - 4, N'分配角色', 50, 'fa fa-fa', 'assignRole', '0', 2);
INSERT [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, N'角色管理', 70, N'fa fa-sitemap', N'~/Admin/Roles', N'0')
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (@@Identity, N'新增', 10, 'fa fa-fa', 'add', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (@@Identity - 1, N'编辑', 20, 'fa fa-fa', 'edit', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (@@Identity - 2, N'删除', 30, 'fa fa-fa', 'del', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (@@Identity - 3, N'分配用户', 40, 'fa fa-fa', 'assignUser', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (@@Identity - 4, N'分配部门', 50, 'fa fa-fa', 'assignGroup', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (@@Identity - 5, N'分配菜单', 60, 'fa fa-fa', 'assignMenu', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (@@Identity - 6, N'分配应用', 70, 'fa fa-fa', 'assignApp', '0', 2);
INSERT [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, N'部门管理', 80, N'fa fa-bank', N'~/Admin/Groups', N'0')
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (@@Identity, N'新增', 10, 'fa fa-fa', 'add', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (@@Identity - 1, N'编辑', 20, 'fa fa-fa', 'edit', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (@@Identity - 2, N'删除', 30, 'fa fa-fa', 'del', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (@@Identity - 3, N'分配用户', 40, 'fa fa-fa', 'assignUser', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (@@Identity - 4, N'分配角色', 50, 'fa fa-fa', 'assignRole', '0', 2);
INSERT [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, N'字典表维护', 90, N'fa fa-book', N'~/Admin/Dicts', N'0')
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (@@Identity, N'新增', 10, 'fa fa-fa', 'add', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (@@Identity - 1, N'编辑', 20, 'fa fa-fa', 'edit', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (@@Identity - 2, N'删除', 30, 'fa fa-fa', 'del', '0', 2);
INSERT [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, N'站内消息', 100, N'fa fa-envelope', N'~/Admin/Messages', N'0')
INSERT [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, N'任务管理', 110, N'fa fa fa-tasks', N'~/Admin/Tasks', N'0')
INSERT [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, N'通知管理', 120, N'fa fa-bell', N'~/Admin/Notifications', N'0')
INSERT [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, N'日志管理', 130, N'fa fa-gears', N'#', N'0')
INSERT [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (@@Identity, N'操作日志', 10, N'fa fa-edit', N'~/Admin/Logs', N'0')
INSERT [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (@@Identity - 1, N'登录日志', 20, N'fa fa-user-circle-o', N'~/Admin/Logins', N'0')
INSERT [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (@@Identity - 2, N'访问日志', 30, N'fa fa-bars', N'~/Admin/Traces', N'0')
INSERT [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, N'在线用户', 140, N'fa fa-users', N'~/Admin/Online', N'0')
INSERT [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, N'程序异常', 150, N'fa fa-cubes', N'~/Admin/Exceptions', N'0')
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (@@Identity, N'服务器日志', 10, N'fa fa-fa', N'log', N'0', 2)
INSERT [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, N'工具集合', 160, N'fa fa-gavel', N'#', N'0')
INSERT [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (@@Identity, N'客户端测试', 10, N'fa fa-wrench', N'~/Admin/Mobile', N'0')
INSERT [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (@@Identity - 1, N'API文档', 10, N'fa fa-wrench', N'~/swagger', N'0')
INSERT [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (@@Identity - 2, N'图标集', 10, N'fa fa-dashboard', N'~/Admin/FAIcon', N'0')
DELETE FROM GROUPS WHERE ID = 1
SET IDENTITY_INSERT [dbo].[Groups] ON

View File

@ -23,6 +23,66 @@
"IsResource": NumberInt(0),
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4a01"),
"ParentId": "5bd7b8445fa31256f77e4b91",
"Name": "保存显示名称",
"Order": NumberInt(10),
"Icon": "fa fa-fa",
"Url": "saveDisplayName",
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4a02"),
"ParentId": "5bd7b8445fa31256f77e4b91",
"Name": "保存密码",
"Order": NumberInt(20),
"Icon": "fa fa-fa",
"Url": "savePassword",
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4a03"),
"ParentId": "5bd7b8445fa31256f77e4b91",
"Name": "保存应用",
"Order": NumberInt(30),
"Icon": "fa fa-fa",
"Url": "saveApp",
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4a04"),
"ParentId": "5bd7b8445fa31256f77e4b91",
"Name": "保存样式",
"Order": NumberInt(40),
"Icon": "fa fa-fa",
"Url": "saveTheme",
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4a05"),
"ParentId": "5bd7b8445fa31256f77e4b91",
"Name": "保存头像",
"Order": NumberInt(50),
"Icon": "fa fa-fa",
"Url": "saveIcon",
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b92"),
"ParentId": "0",
@ -47,6 +107,66 @@
"IsResource": NumberInt(0),
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b01"),
"ParentId": "5bd7b8445fa31256f77e4b93",
"Name": "保存系统名称",
"Order": NumberInt(10),
"Icon": "fa fa-fa",
"Url": "saveTitle",
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b02"),
"ParentId": "5bd7b8445fa31256f77e4b93",
"Name": "保存页脚设置",
"Order": NumberInt(20),
"Icon": "fa fa-fa",
"Url": "saveFooter",
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b03"),
"ParentId": "5bd7b8445fa31256f77e4b93",
"Name": "保存样式",
"Order": NumberInt(30),
"Icon": "fa fa-fa",
"Url": "saveTheme",
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b04"),
"ParentId": "5bd7b8445fa31256f77e4b93",
"Name": "清理缓存",
"Order": NumberInt(40),
"Icon": "fa fa-fa",
"Url": "clearCache",
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b05"),
"ParentId": "5bd7b8445fa31256f77e4b93",
"Name": "清理全部缓存",
"Order": NumberInt(50),
"Icon": "fa fa-fa",
"Url": "clearAllCache",
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b94"),
"ParentId": "0",
@ -59,6 +179,66 @@
"IsResource": NumberInt(0),
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b10"),
"ParentId": "5bd7b8445fa31256f77e4b94",
"Name": "新增",
"Order": NumberInt(10),
"Icon": "fa fa-fa",
"Url": "add",
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b11"),
"ParentId": "5bd7b8445fa31256f77e4b94",
"Name": "编辑",
"Order": NumberInt(20),
"Icon": "fa fa-fa",
"Url": "edit",
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b12"),
"ParentId": "5bd7b8445fa31256f77e4b94",
"Name": "删除",
"Order": NumberInt(30),
"Icon": "fa fa-fa",
"Url": "del",
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b13"),
"ParentId": "5bd7b8445fa31256f77e4b94",
"Name": "分配角色",
"Order": NumberInt(40),
"Icon": "fa fa-fa",
"Url": "assignRole",
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b14"),
"ParentId": "0",
"Name": "图标页面",
"Order": NumberInt(55),
"Icon": "fa fa-fa",
"Url": "~/Admin/IconView",
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(1),
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b95"),
"ParentId": "0",
@ -71,6 +251,66 @@
"IsResource": NumberInt(0),
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b20"),
"ParentId": "5bd7b8445fa31256f77e4b95",
"Name": "新增",
"Order": NumberInt(10),
"Icon": "fa fa-fa",
"Url": "add",
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b21"),
"ParentId": "5bd7b8445fa31256f77e4b95",
"Name": "编辑",
"Order": NumberInt(20),
"Icon": "fa fa-fa",
"Url": "edit",
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b22"),
"ParentId": "5bd7b8445fa31256f77e4b95",
"Name": "删除",
"Order": NumberInt(30),
"Icon": "fa fa-fa",
"Url": "del",
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b23"),
"ParentId": "5bd7b8445fa31256f77e4b95",
"Name": "分配部门",
"Order": NumberInt(40),
"Icon": "fa fa-fa",
"Url": "assignGroup",
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b24"),
"ParentId": "5bd7b8445fa31256f77e4b95",
"Name": "分配角色",
"Order": NumberInt(50),
"Icon": "fa fa-fa",
"Url": "assignRole",
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b96"),
"ParentId": "0",
@ -83,6 +323,90 @@
"IsResource": NumberInt(0),
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b30"),
"ParentId": "5bd7b8445fa31256f77e4b96",
"Name": "新增",
"Order": NumberInt(10),
"Icon": "fa fa-fa",
"Url": "add",
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b31"),
"ParentId": "5bd7b8445fa31256f77e4b96",
"Name": "编辑",
"Order": NumberInt(20),
"Icon": "fa fa-fa",
"Url": "edit",
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b32"),
"ParentId": "5bd7b8445fa31256f77e4b96",
"Name": "删除",
"Order": NumberInt(30),
"Icon": "fa fa-fa",
"Url": "del",
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b33"),
"ParentId": "5bd7b8445fa31256f77e4b96",
"Name": "分配用户",
"Order": NumberInt(40),
"Icon": "fa fa-fa",
"Url": "assignUser",
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b34"),
"ParentId": "5bd7b8445fa31256f77e4b96",
"Name": "分配部门",
"Order": NumberInt(50),
"Icon": "fa fa-fa",
"Url": "assignGroup",
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b35"),
"ParentId": "5bd7b8445fa31256f77e4b96",
"Name": "分配菜单",
"Order": NumberInt(60),
"Icon": "fa fa-fa",
"Url": "assignMenu",
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b36"),
"ParentId": "5bd7b8445fa31256f77e4b96",
"Name": "分配应用",
"Order": NumberInt(70),
"Icon": "fa fa-fa",
"Url": "assignApp",
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b97"),
"ParentId": "0",
@ -95,6 +419,66 @@
"IsResource": NumberInt(0),
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b40"),
"ParentId": "5bd7b8445fa31256f77e4b97",
"Name": "新增",
"Order": NumberInt(10),
"Icon": "fa fa-fa",
"Url": "add",
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b41"),
"ParentId": "5bd7b8445fa31256f77e4b97",
"Name": "编辑",
"Order": NumberInt(20),
"Icon": "fa fa-fa",
"Url": "edit",
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b42"),
"ParentId": "5bd7b8445fa31256f77e4b97",
"Name": "删除",
"Order": NumberInt(30),
"Icon": "fa fa-fa",
"Url": "del",
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b43"),
"ParentId": "5bd7b8445fa31256f77e4b97",
"Name": "分配用户",
"Order": NumberInt(40),
"Icon": "fa fa-fa",
"Url": "assignUser",
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b44"),
"ParentId": "5bd7b8445fa31256f77e4b97",
"Name": "分配角色",
"Order": NumberInt(50),
"Icon": "fa fa-fa",
"Url": "assignRole",
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b98"),
"ParentId": "0",
@ -107,6 +491,42 @@
"IsResource": NumberInt(0),
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b50"),
"ParentId": "5bd7b8445fa31256f77e4b98",
"Name": "新增",
"Order": NumberInt(10),
"Icon": "fa fa-fa",
"Url": "add",
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b51"),
"ParentId": "5bd7b8445fa31256f77e4b98",
"Name": "编辑",
"Order": NumberInt(20),
"Icon": "fa fa-fa",
"Url": "edit",
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b52"),
"ParentId": "5bd7b8445fa31256f77e4b98",
"Name": "删除",
"Order": NumberInt(30),
"Icon": "fa fa-fa",
"Url": "del",
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b99"),
"ParentId": "0",
@ -215,6 +635,18 @@
"IsResource": NumberInt(0),
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b60"),
"ParentId": "5bd7b8445fa31256f77e4b9d",
"Name": "服务器日志",
"Order": NumberInt(10),
"Icon": "fa fa-fa",
"Url": "log",
"Category": "0",
"Target": "_self",
"IsResource": NumberInt(2),
"Application": "0"
},
{
"_id": ObjectId("5bd7b8445fa31256f77e4b9e"),
"ParentId": "0",

View File

@ -3,50 +3,14 @@
"_id": ObjectId("5bd7cc105fa31256f77e4eb7"),
"RoleName": "Administrators",
"Description": "系统管理员",
"Menus": [
"5bd7b8445fa31256f77e4b90",
"5bd7b8445fa31256f77e4b91",
"5bd7b8445fa31256f77e4b92",
"5bd7b8445fa31256f77e4b93",
"5bd7b8445fa31256f77e4b94",
"5bd7b8445fa31256f77e4b95",
"5bd7b8445fa31256f77e4b96",
"5bd7b8445fa31256f77e4b97",
"5bd7b8445fa31256f77e4b98",
"5bd7b8445fa31256f77e4b99",
"5bd7b8445fa31256f77e4b9a",
"5bd7b8445fa31256f77e4b9b",
"5bd7b8445fa31256f77e4b9c",
"5bd7b8445fa31256f77e4b9d",
"5bd7b8445fa31256f77e4b9e",
"5bd7b8445fa31256f77e4b9f",
"5bd7b8445fa31256f77e4ba0",
"5bd7b8445fa31256f77e4ba1",
"5bd7b8445fa31256f77e4ba2",
"5bd9b3d868aa001661776f56",
"5bd7b8445fa31256f77e4ba4"
],
"Menus": [],
"Apps": []
},
{
"_id": ObjectId("5bd7cc105fa31256f77e4eb8"),
"RoleName": "Default",
"Description": "默认用户,可访问前台页面",
"Menus": [
"5bd7b8445fa31256f77e4b90",
"5bd7b8445fa31256f77e4b91",
"5bd7b8445fa31256f77e4b92",
"5bd7b8445fa31256f77e4b99",
"5bd7b8445fa31256f77e4b9a",
"5bd7b8445fa31256f77e4b9b",
"5bd7b8445fa31256f77e4b9e",
"5bd7b8445fa31256f77e4b9f",
"5bd7b8445fa31256f77e4ba0",
"5bd7b8445fa31256f77e4ba1",
"5bd7b8445fa31256f77e4ba2",
"5bd9b3d868aa001661776f56",
"5bd7b8445fa31256f77e4ba4"
],
"Menus": [],
"Apps": []
}
]

View File

@ -40,30 +40,65 @@ INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('系统设置', 'Cookie
INSERT INTO Dicts (Category, Name, Code, Define) VALUES ('系统设置', '获取IP地点', '0', 0);
DELETE FROM Navigations;
ALTER TABLE Navigations MODIFY COLUMN ID INT NOT NULL;
INSERT INTO Navigations (ID, ParentId, Name, `Order`, Icon, Url, Category) VALUES (1, 0, '后台管理', 10, 'fa fa-gear', '~/Admin/Index', '0');
INSERT INTO Navigations (ID, ParentId, Name, `Order`, Icon, Url, Category) VALUES (2, 0, '个人中心', 20, 'fa fa-suitcase', '~/Admin/Profiles', '0');
INSERT INTO Navigations (ID, ParentId, Name, `Order`, Icon, Url, Category) VALUES (3, 0, '返回前台', 30, 'fa fa-hand-o-left', '~/Home/Index', '0');
INSERT INTO Navigations (ID, ParentId, Name, `Order`, Icon, Url, Category) VALUES (4, 0, '网站设置', 40, 'fa fa-fa', '~/Admin/Settings', '0');
INSERT INTO Navigations (ID, ParentId, Name, `Order`, Icon, Url, Category) VALUES (5, 0, '菜单管理', 50, 'fa fa-dashboard', '~/Admin/Menus', '0');
INSERT INTO Navigations (ID, ParentId, Name, `Order`, Icon, Url, Category) VALUES (6, 0, '用户管理', 60, 'fa fa-user', '~/Admin/Users', '0');
INSERT INTO Navigations (ID, ParentId, Name, `Order`, Icon, Url, Category) VALUES (7, 0, '角色管理', 70, 'fa fa-sitemap', '~/Admin/Roles', '0');
INSERT INTO Navigations (ID, ParentId, Name, `Order`, Icon, Url, Category) VALUES (8, 0, '部门管理', 80, 'fa fa-bank', '~/Admin/Groups', '0');
INSERT INTO Navigations (ID, ParentId, Name, `Order`, Icon, Url, Category) VALUES (9, 0, '字典表维护', 90, 'fa fa-book', '~/Admin/Dicts', '0');
INSERT INTO Navigations (ID, ParentId, Name, `Order`, Icon, Url, Category) VALUES (10, 0, '站内消息', 100, 'fa fa-envelope', '~/Admin/Messages', '0');
INSERT INTO Navigations (ID, ParentId, Name, `Order`, Icon, Url, Category) VALUES (11, 0, '任务管理', 110, 'fa fa fa-tasks', '~/Admin/Tasks', '0');
INSERT INTO Navigations (ID, ParentId, Name, `Order`, Icon, Url, Category) VALUES (12, 0, '通知管理', 120, 'fa fa-bell', '~/Admin/Notifications', '0');
INSERT INTO Navigations (ID, ParentId, Name, `Order`, Icon, Url, Category) VALUES (13, 0, '系统日志', 130, 'fa fa-gears', '#', '0');
INSERT INTO Navigations (ID, ParentId, Name, `Order`, Icon, Url, Category) VALUES (20, 13, '操作日志', 10, 'fa fa-edit', '~/Admin/Logs', '0');
INSERT INTO Navigations (ID, ParentId, Name, `Order`, Icon, Url, Category) VALUES (21, 13, '登录日志', 20, 'fa fa-user-circle-o', '~/Admin/Logins', '0');
INSERT INTO Navigations (ID, ParentId, Name, `Order`, Icon, Url, Category) VALUES (21, 13, '访问日志', 30, 'fa fa-bars', '~/Admin/Traces', '0');
INSERT INTO Navigations (ID, ParentId, Name, `Order`, Icon, Url, Category) VALUES (14, 0, '在线用户', 140, 'fa fa-users', '~/Admin/Online', '0');
INSERT INTO Navigations (ID, ParentId, Name, `Order`, Icon, Url, Category) VALUES (15, 0, '程序异常', 150, 'fa fa-cubes', '~/Admin/Exceptions', '0');
INSERT INTO Navigations (ID, ParentId, Name, `Order`, Icon, Url, Category) VALUES (16, 0, '工具集合', 160, 'fa fa-gavel', '#', '0');
INSERT INTO Navigations (ID, ParentId, Name, `Order`, Icon, Url, Category) VALUES (17, 16, '客户端测试', 10, 'fa fa-wrench', '~/Admin/Mobile', '0');
INSERT INTO Navigations (ID, ParentId, Name, `Order`, Icon, Url, Category) VALUES (18, 16, 'API文档', 10, 'fa fa-wrench', '~/swagger', '0');
INSERT INTO Navigations (ID, ParentId, Name, `Order`, Icon, Url, Category) VALUES (19, 16, '图标集', 10, 'fa fa-dashboard', '~/Admin/FAIcon', '0');
ALTER TABLE Navigations MODIFY COLUMN ID INT NOT NULL AUTO_INCREMENT;
Truncate Navigations;
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category) VALUES (0, '后台管理', 10, 'fa fa-gear', '~/Admin/Index', '0');
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category) VALUES (0, '个人中心', 20, 'fa fa-suitcase', '~/Admin/Profiles', '0');
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResource) VALUES (@@identity, '保存显示名称', 10, 'fa fa-fa', 'saveDisplayName', '0', 2);
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResource) VALUES (@@identity - 1, '保存密码', 20, 'fa fa-fa', 'savePassword', '0', 2);
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResource) VALUES (@@identity - 2, '保存应用', 30, 'fa fa-fa', 'saveApp', '0', 2);
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResource) VALUES (@@identity - 3, '保存样式', 40, 'fa fa-fa', 'saveTheme', '0', 2);
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResource) VALUES (@@identity - 4, '保存头像', 50, 'fa fa-fa', 'saveIcon', '0', 2);
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category) VALUES (0, '返回前台', 30, 'fa fa-hand-o-left', '~/Home/Index', '0');
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category) VALUES (0, '网站设置', 40, 'fa fa-fa', '~/Admin/Settings', '0');
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResource) VALUES (@@identity, '保存系统名称', 10, 'fa fa-fa', 'saveTitle', '0', 2);
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResource) VALUES (@@identity - 1, '保存页脚设置', 20, 'fa fa-fa', 'saveFooter', '0', 2);
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResource) VALUES (@@identity - 2, '保存样式', 30, 'fa fa-fa', 'saveTheme', '0', 2);
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResource) VALUES (@@identity - 3, '清理缓存', 40, 'fa fa-fa', 'clearCache', '0', 2);
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResource) VALUES (@@identity - 4, '清理全部缓存', 50, 'fa fa-fa', 'clearAllCache', '0', 2);
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category) VALUES (0, '菜单管理', 50, 'fa fa-dashboard', '~/Admin/Menus', '0');
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResource) VALUES (@@identity, '新增', 10, 'fa fa-fa', 'add', '0', 2);
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResource) VALUES (@@identity - 1, '编辑', 20, 'fa fa-fa', 'edit', '0', 2);
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResource) VALUES (@@identity - 2, '删除', 30, 'fa fa-fa', 'del', '0', 2);
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResource) VALUES (@@identity - 3, '分配角色', 40, 'fa fa-fa', 'assignRole', '0', 2);
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResource) VALUES (0, '图标页面', 50, 'fa fa-fa', '~/Admin/IconView', '0', 1);
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category) VALUES (0, '用户管理', 60, 'fa fa-user', '~/Admin/Users', '0');
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResource) VALUES (@@identity, '新增', 10, 'fa fa-fa', 'add', '0', 2);
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResource) VALUES (@@identity - 1, '编辑', 20, 'fa fa-fa', 'edit', '0', 2);
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResource) VALUES (@@identity - 2, '删除', 30, 'fa fa-fa', 'del', '0', 2);
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResource) VALUES (@@identity - 3, '分配部门', 40, 'fa fa-fa', 'assignGroup', '0', 2);
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResource) VALUES (@@identity - 4, '分配角色', 50, 'fa fa-fa', 'assignRole', '0', 2);
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category) VALUES (0, '角色管理', 70, 'fa fa-sitemap', '~/Admin/Roles', '0');
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResource) VALUES (@@identity, '新增', 10, 'fa fa-fa', 'add', '0', 2);
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResource) VALUES (@@identity - 1, '编辑', 20, 'fa fa-fa', 'edit', '0', 2);
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResource) VALUES (@@identity - 2, '删除', 30, 'fa fa-fa', 'del', '0', 2);
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResource) VALUES (@@identity - 3, '分配用户', 40, 'fa fa-fa', 'assignUser', '0', 2);
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResource) VALUES (@@identity - 4, '分配部门', 50, 'fa fa-fa', 'assignGroup', '0', 2);
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResource) VALUES (@@identity - 5, '分配菜单', 60, 'fa fa-fa', 'assignMenu', '0', 2);
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResource) VALUES (@@identity - 6, '分配应用', 70, 'fa fa-fa', 'assignApp', '0', 2);
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category) VALUES (0, '部门管理', 80, 'fa fa-bank', '~/Admin/Groups', '0');
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResource) VALUES (@@identity, '新增', 10, 'fa fa-fa', 'add', '0', 2);
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResource) VALUES (@@identity - 1, '编辑', 20, 'fa fa-fa', 'edit', '0', 2);
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResource) VALUES (@@identity - 2, '删除', 30, 'fa fa-fa', 'del', '0', 2);
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResource) VALUES (@@identity - 3, '分配用户', 40, 'fa fa-fa', 'assignUser', '0', 2);
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResource) VALUES (@@identity - 4, '分配角色', 50, 'fa fa-fa', 'assignRole', '0', 2);
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category) VALUES (0, '字典表维护', 90, 'fa fa-book', '~/Admin/Dicts', '0');
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResource) VALUES (@@identity, '新增', 10, 'fa fa-fa', 'add', '0', 2);
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResource) VALUES (@@identity - 1, '编辑', 20, 'fa fa-fa', 'edit', '0', 2);
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResource) VALUES (@@identity - 2, '删除', 30, 'fa fa-fa', 'del', '0', 2);
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category) VALUES (0, '站内消息', 100, 'fa fa-envelope', '~/Admin/Messages', '0');
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category) VALUES (0, '任务管理', 110, 'fa fa fa-tasks', '~/Admin/Tasks', '0');
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category) VALUES (0, '通知管理', 120, 'fa fa-bell', '~/Admin/Notifications', '0');
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category) VALUES (0, '系统日志', 130, 'fa fa-gears', '#', '0');
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category) VALUES (@@identity, '操作日志', 10, 'fa fa-edit', '~/Admin/Logs', '0');
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category) VALUES (@@identity - 1, '登录日志', 20, 'fa fa-user-circle-o', '~/Admin/Logins', '0');
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category) VALUES (@@identity - 2, '访问日志', 30, 'fa fa-bars', '~/Admin/Traces', '0');
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category) VALUES (0, '在线用户', 140, 'fa fa-users', '~/Admin/Online', '0');
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category) VALUES (0, '程序异常', 150, 'fa fa-cubes', '~/Admin/Exceptions', '0');
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResource) VALUES (@@identity, '服务器日志', 10, 'fa fa-fa', 'log', '0', 2);
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category) VALUES (0, '工具集合', 160, 'fa fa-gavel', '#', '0');
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category) VALUES (@@identity, '客户端测试', 10, 'fa fa-wrench', '~/Admin/Mobile', '0');
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category) VALUES (@@identity - 1, 'API文档', 10, 'fa fa-wrench', '~/swagger', '0');
INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category) VALUES (@@identity - 2, '图标集', 10, 'fa fa-dashboard', '~/Admin/FAIcon', '0');
DELETE FROM `Groups` WHERE ID = 1;
ALTER TABLE `Groups` MODIFY COLUMN ID INT NOT NULL;
@ -87,15 +122,6 @@ INSERT INTO UserRole (UserID, RoleID) VALUES (1, 1);
INSERT INTO UserRole (UserID, RoleID) VALUES (1, 2);
DELETE FROM NavigationRole;
INSERT INTO NavigationRole SELECT NULL, ID, 1 FROM navigations;
INSERT INTO NavigationRole (NavigationID, RoleID) VALUES (1, 2);
INSERT INTO NavigationRole (NavigationID, RoleID) VALUES (2, 2);
INSERT INTO NavigationRole (NavigationID, RoleID) VALUES (3, 2);
INSERT INTO NavigationRole (NavigationID, RoleID) VALUES (10, 2);
INSERT INTO NavigationRole (NavigationID, RoleID) VALUES (16, 2);
INSERT INTO NavigationRole (NavigationID, RoleID) VALUES (17, 2);
INSERT INTO NavigationRole (NavigationID, RoleID) VALUES (18, 2);
INSERT INTO NavigationRole (NavigationID, RoleID) VALUES (19, 2);
-- Client Data
Delete From Dicts Where Category = '应用程序' and Code = 2;

View File

@ -153,7 +153,7 @@ CREATE TABLE LoginLogs(
ID INTEGER PRIMARY KEY Auto_increment,
UserName VARCHAR (50) NOT NULL,
LoginTime DATETIME NOT NULL,
Ip VARCHAR NOT NULL,
Ip VARCHAR (15) NOT NULL,
OS VARCHAR (50) NULL,
Browser VARCHAR (50) NULL,
City VARCHAR (50) NULL,

View File

@ -43,13 +43,48 @@ DELETE FROM Navigations;
ALTER SEQUENCE navigations_id_seq RESTART WITH 1;
INSERT INTO Navigations (ParentId, Name, "order", Icon, Url, Category) VALUES (0, '后台管理', 10, 'fa fa-gear', '~/Admin/Index', '0');
INSERT INTO Navigations (ParentId, Name, "order", Icon, Url, Category) VALUES (0, '个人中心', 20, 'fa fa-suitcase', '~/Admin/Profiles', '0');
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (currval('navigations_id_seq') - 1, '保存显示名称', 10, 'fa fa-fa', 'saveDisplayName', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (currval('navigations_id_seq') - 2, '保存密码', 20, 'fa fa-fa', 'savePassword', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (currval('navigations_id_seq') - 3, '保存应用', 30, 'fa fa-fa', 'saveApp', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (currval('navigations_id_seq') - 4, '保存样式', 40, 'fa fa-fa', 'saveTheme', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (currval('navigations_id_seq') - 5, '保存头像', 50, 'fa fa-fa', 'saveIcon', '0', 2);
INSERT INTO Navigations (ParentId, Name, "order", Icon, Url, Category) VALUES (0, '返回前台', 30, 'fa fa-hand-o-left', '~/Home/Index', '0');
INSERT INTO Navigations (ParentId, Name, "order", Icon, Url, Category) VALUES (0, '网站设置', 40, 'fa fa-fa', '~/Admin/Settings', '0');
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (currval('navigations_id_seq') - 1, '保存系统名称', 10, 'fa fa-fa', 'saveTitle', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (currval('navigations_id_seq') - 2, '保存页脚设置', 20, 'fa fa-fa', 'saveFooter', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (currval('navigations_id_seq') - 3, '保存样式', 30, 'fa fa-fa', 'saveTheme', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (currval('navigations_id_seq') - 4, '清理缓存', 40, 'fa fa-fa', 'clearCache', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (currval('navigations_id_seq') - 5, '清理全部缓存', 50, 'fa fa-fa', 'clearAllCache', '0', 2);
INSERT INTO Navigations (ParentId, Name, "order", Icon, Url, Category) VALUES (0, '菜单管理', 50, 'fa fa-dashboard', '~/Admin/Menus', '0');
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (currval('navigations_id_seq') - 1, '新增', 10, 'fa fa-fa', 'add', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (currval('navigations_id_seq') - 2, '编辑', 20, 'fa fa-fa', 'edit', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (currval('navigations_id_seq') - 3, '删除', 30, 'fa fa-fa', 'del', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (currval('navigations_id_seq') - 4, '分配角色', 40, 'fa fa-fa', 'assignRole', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (0, '图标页面', 50, 'fa fa-fa', '~/Admin/IconView', '0', 1);
INSERT INTO Navigations (ParentId, Name, "order", Icon, Url, Category) VALUES (0, '用户管理', 60, 'fa fa-user', '~/Admin/Users', '0');
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (currval('navigations_id_seq') - 1, '新增', 10, 'fa fa-fa', 'add', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (currval('navigations_id_seq') - 2, '编辑', 20, 'fa fa-fa', 'edit', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (currval('navigations_id_seq') - 3, '删除', 30, 'fa fa-fa', 'del', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (currval('navigations_id_seq') - 4, '分配部门', 40, 'fa fa-fa', 'assignGroup', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (currval('navigations_id_seq') - 5, '分配角色', 50, 'fa fa-fa', 'assignRole', '0', 2);
INSERT INTO Navigations (ParentId, Name, "order", Icon, Url, Category) VALUES (0, '角色管理', 70, 'fa fa-sitemap', '~/Admin/Roles', '0');
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (currval('navigations_id_seq') - 1, '新增', 10, 'fa fa-fa', 'add', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (currval('navigations_id_seq') - 2, '编辑', 20, 'fa fa-fa', 'edit', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (currval('navigations_id_seq') - 3, '删除', 30, 'fa fa-fa', 'del', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (currval('navigations_id_seq') - 4, '分配用户', 40, 'fa fa-fa', 'assignUser', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (currval('navigations_id_seq') - 5, '分配部门', 50, 'fa fa-fa', 'assignGroup', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (currval('navigations_id_seq') - 6, '分配菜单', 60, 'fa fa-fa', 'assignMenu', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (currval('navigations_id_seq') - 7, '分配应用', 70, 'fa fa-fa', 'assignApp', '0', 2);
INSERT INTO Navigations (ParentId, Name, "order", Icon, Url, Category) VALUES (0, '部门管理', 80, 'fa fa-bank', '~/Admin/Groups', '0');
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (currval('navigations_id_seq') - 1, '新增', 10, 'fa fa-fa', 'add', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (currval('navigations_id_seq') - 2, '编辑', 20, 'fa fa-fa', 'edit', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (currval('navigations_id_seq') - 3, '删除', 30, 'fa fa-fa', 'del', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (currval('navigations_id_seq') - 4, '分配用户', 40, 'fa fa-fa', 'assignUser', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (currval('navigations_id_seq') - 5, '分配角色', 50, 'fa fa-fa', 'assignRole', '0', 2);
INSERT INTO Navigations (ParentId, Name, "order", Icon, Url, Category) VALUES (0, '字典表维护', 90, 'fa fa-book', '~/Admin/Dicts', '0');
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (currval('navigations_id_seq') - 1, '新增', 10, 'fa fa-fa', 'add', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (currval('navigations_id_seq') - 2, '编辑', 20, 'fa fa-fa', 'edit', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (currval('navigations_id_seq') - 3, '删除', 30, 'fa fa-fa', 'del', '0', 2);
INSERT INTO Navigations (ParentId, Name, "order", Icon, Url, Category) VALUES (0, '站内消息', 100, 'fa fa-envelope', '~/Admin/Messages', '0');
INSERT INTO Navigations (ParentId, Name, "order", Icon, Url, Category) VALUES (0, '任务管理', 110, 'fa fa fa-tasks', '~/Admin/Tasks', '0');
INSERT INTO Navigations (ParentId, Name, "order", Icon, Url, Category) VALUES (0, '通知管理', 120, 'fa fa-bell', '~/Admin/Notifications', '0');
@ -59,6 +94,7 @@ INSERT INTO Navigations (ParentId, Name, "order", Icon, Url, Category) VALUES (c
INSERT INTO Navigations (ParentId, Name, "order", Icon, Url, Category) VALUES (currval('navigations_id_seq') - 3, 0, '访问日志', 30, 'fa fa-bars', '~/Admin/Traces', '0');
INSERT INTO Navigations (ParentId, Name, "order", Icon, Url, Category) VALUES (0, '在线用户', 140, 'fa fa-users', '~/Admin/Online', '0');
INSERT INTO Navigations (ParentId, Name, "order", Icon, Url, Category) VALUES (0, '程序异常', 150, 'fa fa-cubes', '~/Admin/Exceptions', '0');
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (currval('navigations_id_seq') - 1, '服务器日志', 10, 'fa fa-fa', 'log', '0', 2);
INSERT INTO Navigations (ParentId, Name, "order", Icon, Url, Category) VALUES (0, '工具集合', 160, 'fa fa-gavel', '#', '0');
INSERT INTO Navigations (ParentId, Name, "order", Icon, Url, Category) VALUES (currval('navigations_id_seq') - 1, '客户端测试', 10, 'fa fa-wrench', '~/Admin/Mobile', '0');
INSERT INTO Navigations (ParentId, Name, "order", Icon, Url, Category) VALUES (currval('navigations_id_seq') - 2, 'API文档', 10, 'fa fa-wrench', '~/swagger', '0');
@ -84,15 +120,6 @@ INSERT INTO UserRole (UserID, RoleID) VALUES (1, 1);
INSERT INTO UserRole (UserID, RoleID) VALUES (1, 2);
DELETE FROM NavigationRole;
INSERT INTO NavigationRole (NavigationID, RoleID) SELECT ID, 1 FROM navigations;
INSERT INTO NavigationRole (NavigationID, RoleID) VALUES (1, 2);
INSERT INTO NavigationRole (NavigationID, RoleID) VALUES (2, 2);
INSERT INTO NavigationRole (NavigationID, RoleID) VALUES (3, 2);
INSERT INTO NavigationRole (NavigationID, RoleID) VALUES (10, 2);
INSERT INTO NavigationRole (NavigationID, RoleID) VALUES (16, 2);
INSERT INTO NavigationRole (NavigationID, RoleID) VALUES (17, 2);
INSERT INTO NavigationRole (NavigationID, RoleID) VALUES (18, 2);
INSERT INTO NavigationRole (NavigationID, RoleID) VALUES (19, 2);
-- Client Data
Delete From Dicts Where Category = '应用程序' and Code = '2';

View File

@ -40,13 +40,48 @@ INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('系统设置
DELETE FROM Navigations;
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, '后台管理', 10, 'fa fa-gear', '~/Admin/Index', '0');
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, '个人中心', 20, 'fa fa-suitcase', '~/Admin/Profiles', '0');
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (last_insert_rowid(), '保存显示名称', 10, 'fa fa-fa', 'saveDisplayName', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (last_insert_rowid() - 1, '保存密码', 20, 'fa fa-fa', 'savePassword', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (last_insert_rowid() - 2, '保存应用', 30, 'fa fa-fa', 'saveApp', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (last_insert_rowid() - 3, '保存样式', 40, 'fa fa-fa', 'saveTheme', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (last_insert_rowid() - 4, '保存头像', 50, 'fa fa-fa', 'saveIcon', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, '返回前台', 30, 'fa fa-hand-o-left', '~/Home/Index', '0');
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, '网站设置', 40, 'fa fa-fa', '~/Admin/Settings', '0');
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (last_insert_rowid(), '保存系统名称', 10, 'fa fa-fa', 'saveTitle', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (last_insert_rowid() - 1, '保存页脚设置', 20, 'fa fa-fa', 'saveFooter', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (last_insert_rowid() - 2, '保存样式', 30, 'fa fa-fa', 'saveTheme', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (last_insert_rowid() - 3, '清理缓存', 40, 'fa fa-fa', 'clearCache', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (last_insert_rowid() - 4, '清理全部缓存', 50, 'fa fa-fa', 'clearAllCache', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, '菜单管理', 50, 'fa fa-dashboard', '~/Admin/Menus', '0');
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (last_insert_rowid(), '新增', 10, 'fa fa-fa', 'add', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (last_insert_rowid() - 1, '编辑', 20, 'fa fa-fa', 'edit', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (last_insert_rowid() - 2, '删除', 30, 'fa fa-fa', 'del', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (last_insert_rowid() - 3, '分配角色', 40, 'fa fa-fa', 'assignRole', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (0, '图标页面', 50, 'fa fa-fa', '~/Admin/IconView', '0', 1);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, '用户管理', 60, 'fa fa-user', '~/Admin/Users', '0');
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (last_insert_rowid(), '新增', 10, 'fa fa-fa', 'add', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (last_insert_rowid() - 1, '编辑', 20, 'fa fa-fa', 'edit', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (last_insert_rowid() - 2, '删除', 30, 'fa fa-fa', 'del', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (last_insert_rowid() - 3, '分配部门', 40, 'fa fa-fa', 'assignGroup', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (last_insert_rowid() - 4, '分配角色', 50, 'fa fa-fa', 'assignRole', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, '角色管理', 70, 'fa fa-sitemap', '~/Admin/Roles', '0');
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (last_insert_rowid(), '新增', 10, 'fa fa-fa', 'add', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (last_insert_rowid() - 1, '编辑', 20, 'fa fa-fa', 'edit', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (last_insert_rowid() - 2, '删除', 30, 'fa fa-fa', 'del', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (last_insert_rowid() - 3, '分配用户', 40, 'fa fa-fa', 'assignUser', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (last_insert_rowid() - 4, '分配部门', 50, 'fa fa-fa', 'assignGroup', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (last_insert_rowid() - 5, '分配菜单', 60, 'fa fa-fa', 'assignMenu', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (last_insert_rowid() - 6, '分配应用', 70, 'fa fa-fa', 'assignApp', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, '部门管理', 80, 'fa fa-bank', '~/Admin/Groups', '0');
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (last_insert_rowid(), '新增', 10, 'fa fa-fa', 'add', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (last_insert_rowid() - 1, '编辑', 20, 'fa fa-fa', 'edit', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (last_insert_rowid() - 2, '删除', 30, 'fa fa-fa', 'del', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (last_insert_rowid() - 3, '分配用户', 40, 'fa fa-fa', 'assignUser', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (last_insert_rowid() - 4, '分配角色', 50, 'fa fa-fa', 'assignRole', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, '字典表维护', 90, 'fa fa-book', '~/Admin/Dicts', '0');
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (last_insert_rowid(), '新增', 10, 'fa fa-fa', 'add', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (last_insert_rowid() - 1, '编辑', 20, 'fa fa-fa', 'edit', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (last_insert_rowid() - 2, '删除', 30, 'fa fa-fa', 'del', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, '站内消息', 100, 'fa fa-envelope', '~/Admin/Messages', '0');
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, '任务管理', 110, 'fa fa fa-tasks', '~/Admin/Tasks', '0');
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, '通知管理', 120, 'fa fa-bell', '~/Admin/Notifications', '0');
@ -56,10 +91,11 @@ INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (last_insert_rowid() - 2, '访问日志', 30, 'fa fa-bars', '~/Admin/Traces', '0');
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, '在线用户', 140, 'fa fa-users', '~/Admin/Online', '0');
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, '程序异常', 150, 'fa fa-cubes', '~/Admin/Exceptions', '0');
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (last_insert_rowid(), '服务器日志', 10, 'fa fa-fa', 'log', '0', 2);
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, '工具集合', 160, 'fa fa-gavel', '#', '0');
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (last_insert_rowid(), '客户端测试', 10, 'fa fa-wrench', '~/Admin/Mobile', '0');
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (last_insert_rowid() - 1, 'API文档', 10, 'fa fa-wrench', '~/swagger', '0');
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (last_insert_rowid() - 2, '图标集', 10, 'fa fa-dashboard', '~/Admin/FAIcon', '0');
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (last_insert_rowid() - 1, 'API文档', 20, 'fa fa-wrench', '~/swagger', '0');
INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (last_insert_rowid() - 2, '图标集', 30, 'fa fa-dashboard', '~/Admin/FAIcon', '0');
DELETE FROM GROUPS WHERE ID = 1;
INSERT INTO [Groups] ([ID], [GroupName], [Description]) VALUES (1, 'Admin', '系统默认组');
@ -79,15 +115,6 @@ INSERT INTO [UserRole] ([UserID], [RoleID]) VALUES (1, 1);
INSERT INTO [UserRole] ([UserID], [RoleID]) VALUES (1, 2);
DELETE FROM NavigationRole;
INSERT INTO NavigationRole SELECT NULL, ID, 1 FROM navigations;
INSERT INTO [NavigationRole] ([NavigationID], [RoleID]) VALUES (1, 2);
INSERT INTO [NavigationRole] ([NavigationID], [RoleID]) VALUES (2, 2);
INSERT INTO [NavigationRole] ([NavigationID], [RoleID]) VALUES (3, 2);
INSERT INTO [NavigationRole] ([NavigationID], [RoleID]) VALUES (10, 2);
INSERT INTO [NavigationRole] ([NavigationID], [RoleID]) VALUES (16, 2);
INSERT INTO [NavigationRole] ([NavigationID], [RoleID]) VALUES (17, 2);
INSERT INTO [NavigationRole] ([NavigationID], [RoleID]) VALUES (18, 2);
INSERT INTO [NavigationRole] ([NavigationID], [RoleID]) VALUES (19, 2);
-- Client Data
Delete From [Dicts] Where Category = '应用程序' and Code = 2;

View File

@ -10,19 +10,11 @@ namespace Bootstrap.Admin.Api
public AppsTest(BAWebHost factory) : base(factory, "api/Apps") { }
[Fact]
public async void Post_Ok()
public async void Get_Ok()
{
var rid = new Role().Retrieves().Where(r => r.RoleName == "Administrators").First().Id;
var cates = await Client.PostAsJsonAsync<string, IEnumerable<App>>(rid, string.Empty);
var cates = await Client.GetAsJsonAsync<IEnumerable<App>>(rid);
Assert.NotEmpty(cates);
}
[Fact]
public async void Put_Ok()
{
var rid = new Role().Retrieves().Where(r => r.RoleName == "Administrators").First().Id;
var ret = await Client.PutAsJsonAsync<IEnumerable<string>, bool>(rid, new string[] { "1", "2" });
Assert.True(ret);
}
}
}

View File

@ -0,0 +1,10 @@
using Xunit;
namespace Bootstrap.Admin.Api.MySql
{
[Collection("MySqlContext")]
public class ProfilesTest : Api.ProfilesTest
{
public ProfilesTest(MySqlBAWebHost factory) : base(factory) { }
}
}

View File

@ -9,14 +9,14 @@ namespace Bootstrap.Admin.Api
public OnlineTest(BAWebHost factory) : base(factory, "api/OnlineUsers") { }
[Fact]
public async void Post_Ok()
public async void Get_Ok()
{
var users = await Client.PostAsJsonAsync<string, IEnumerable<OnlineUser>>(string.Empty);
var users = await Client.GetAsJsonAsync<IEnumerable<OnlineUser>>();
Assert.Single(users);
}
[Fact]
public async void Get_Ok()
public async void GetById_Ok()
{
var urls = await Client.GetAsJsonAsync<IEnumerable<KeyValuePair<DateTime, string>>>("UnitTest");
Assert.Empty(urls);

View File

@ -0,0 +1,50 @@
using Bootstrap.DataAccess;
using System;
using System.Linq;
using Xunit;
namespace Bootstrap.Admin.Api
{
public class ProfilesTest : ControllerTest
{
public ProfilesTest(BAWebHost factory) : base(factory, "api/Profiles") { }
[Fact]
public async void Put_Ok()
{
var usr = new User { UserName = "UnitTest_Change", Password = "1", DisplayName = "DisplayName", ApprovedBy = "System", ApprovedTime = DateTime.Now, Description = "Desc", Icon = "default.jpg", Css = "blue.css" };
usr.Delete(usr.Retrieves().Where(u => u.UserName == usr.UserName).Select(u => u.Id));
Assert.True(usr.Save(usr));
// change theme
usr.UserStatus = UserStates.ChangeTheme;
var resp = await Client.PutAsJsonAsync<User, bool>(usr);
Assert.True(resp);
// Login as new user
var client = Host.CreateClient();
await client.LoginAsync("UnitTest_Change", "1");
// change password
usr.UserStatus = UserStates.ChangePassword;
usr.NewPassword = "1";
usr.Password = "1";
resp = await client.PutAsJsonAsync<User, bool>("/api/Profiles", usr);
Assert.True(resp);
// change displayname
usr.UserStatus = UserStates.ChangeDisplayName;
resp = await client.PutAsJsonAsync<User, bool>("/api/Profiles", usr);
Assert.True(resp);
// change app
usr.App = "UnitTest";
usr.UserStatus = UserStates.SaveApp;
resp = await client.PutAsJsonAsync<User, bool>("/api/Profiles", usr);
Assert.True(resp);
// delete
usr.Delete(usr.Retrieves().Where(u => u.UserName == usr.UserName).Select(u => u.Id));
}
}
}

View File

@ -62,6 +62,9 @@ namespace Bootstrap.Admin.Api
ret = await Client.PutAsJsonAsync<IEnumerable<string>, bool>($"{mid}?type=menu", ids);
Assert.True(ret);
ret = await Client.PutAsJsonAsync<IEnumerable<string>, bool>($"{mid}?type=app", ids);
Assert.True(ret);
}
}
}

View File

@ -0,0 +1,10 @@
using Xunit;
namespace Bootstrap.Admin.Api.SQLite
{
[Collection("SQLiteContext")]
public class ProfilesTest : Api.ProfilesTest
{
public ProfilesTest(SQLiteBAWebHost factory) : base(factory) { }
}
}

View File

@ -76,51 +76,5 @@ namespace Bootstrap.Admin.Api
ret = await Client.PutAsJsonAsync<IEnumerable<string>, bool>($"{rid}?type=role", ids);
Assert.True(ret);
}
[Fact]
public async void Put_Ok()
{
var usr = new User { UserName = "UnitTest_Change", Password = "1", DisplayName = "DisplayName", ApprovedBy = "System", ApprovedTime = DateTime.Now, Description = "Desc", Icon = "default.jpg" };
usr.Delete(usr.Retrieves().Where(u => u.UserName == usr.UserName).Select(u => u.Id));
Assert.True(usr.Save(usr));
// Add author
DbManager.Create().Execute("delete from NavigationRole where RoleID in (select ID from Roles where RoleName = 'Default')");
var rid = DbManager.Create().ExecuteScalar<string>("select ID from Roles where RoleName = 'Default'");
DbManager.Create().InsertBatch("NavigationRole", new Menu().RetrieveAllMenus("Admin").Select(m => new { RoleID = rid, NavigationID = m.Id }));
// change theme
usr.UserStatus = UserStates.ChangeTheme;
var resp = await Client.PutAsJsonAsync<User, bool>(usr);
Assert.False(resp);
// Login as new user
var client = Host.CreateClient();
client.BaseAddress = new Uri("http://localhost/api/Users");
await client.LoginAsync("UnitTest_Change", "1");
resp = await client.PutAsJsonAsync<User, bool>(usr);
Assert.True(resp);
// change password
usr.UserStatus = UserStates.ChangePassword;
usr.NewPassword = "1";
usr.Password = "1";
resp = await client.PutAsJsonAsync<User, bool>(usr);
Assert.True(resp);
// change displayname
usr.UserStatus = UserStates.ChangeDisplayName;
resp = await client.PutAsJsonAsync<User, bool>(usr);
Assert.True(resp);
// change app
usr.App = "UnitTest";
usr.UserStatus = UserStates.SaveApp;
resp = await client.PutAsJsonAsync<User, bool>(usr);
Assert.True(resp);
// delete
usr.Delete(usr.Retrieves().Where(u => u.UserName == usr.UserName).Select(u => u.Id));
}
}
}

Binary file not shown.