From d5bf54a4dc8be9ddecdeb7242970f6e5bcb5174b Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Tue, 20 Aug 2019 17:46:51 +0800 Subject: [PATCH 1/6] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E9=94=81?= =?UTF-8?q?=E5=B1=8F=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/AccountController.cs | 20 +++- Bootstrap.Admin/Models/LockModel.cs | 24 ++++ Bootstrap.Admin/Views/Account/Lock.cshtml | 56 +++++++++ Bootstrap.Admin/wwwroot/css/lock.css | 113 ++++++++++++++++++ Bootstrap.Admin/wwwroot/js/lock.js | 12 ++ 5 files changed, 223 insertions(+), 2 deletions(-) create mode 100644 Bootstrap.Admin/Models/LockModel.cs create mode 100644 Bootstrap.Admin/Views/Account/Lock.cshtml create mode 100644 Bootstrap.Admin/wwwroot/css/lock.css create mode 100644 Bootstrap.Admin/wwwroot/js/lock.js diff --git a/Bootstrap.Admin/Controllers/AccountController.cs b/Bootstrap.Admin/Controllers/AccountController.cs index ff4b7af6..b1848642 100644 --- a/Bootstrap.Admin/Controllers/AccountController.cs +++ b/Bootstrap.Admin/Controllers/AccountController.cs @@ -21,8 +21,24 @@ namespace Bootstrap.Admin.Controllers [AutoValidateAntiforgeryToken] public class AccountController : Controller { + /// - /// + /// 系统锁屏界面 + /// + /// + public ActionResult Lock() + { + var user = UserHelper.RetrieveUserByUserName(User.Identity.Name); + //await HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme); + var urlReferrer = Request.Headers["Referer"].FirstOrDefault(); + return View(new LockModel(this) + { + ReturnUrl = WebUtility.UrlEncode(string.IsNullOrEmpty(urlReferrer) ? CookieAuthenticationDefaults.LoginPath.Value : urlReferrer) + }); + } + + /// + /// 系统登录方法 /// /// [HttpGet] @@ -61,7 +77,7 @@ namespace Bootstrap.Admin.Controllers } /// - /// + /// 创建登录用户信息 /// /// /// diff --git a/Bootstrap.Admin/Models/LockModel.cs b/Bootstrap.Admin/Models/LockModel.cs new file mode 100644 index 00000000..fa90973a --- /dev/null +++ b/Bootstrap.Admin/Models/LockModel.cs @@ -0,0 +1,24 @@ +using Microsoft.AspNetCore.Mvc; + +namespace Bootstrap.Admin.Models +{ + /// + /// 系统锁屏数据模型 + /// + public class LockModel : HeaderBarModel + { + /// + /// 构造函数 + /// + /// + public LockModel(ControllerBase controller) : base(controller.User.Identity) + { + + } + + /// + /// 获得/设置 返回路径 + /// + public string ReturnUrl { get; set; } + } +} diff --git a/Bootstrap.Admin/Views/Account/Lock.cshtml b/Bootstrap.Admin/Views/Account/Lock.cshtml new file mode 100644 index 00000000..34bb4eb6 --- /dev/null +++ b/Bootstrap.Admin/Views/Account/Lock.cshtml @@ -0,0 +1,56 @@ +@model LockModel +@{ + ViewBag.Title = "系统登陆"; + Layout = "~/Views/Shared/_Layout.cshtml"; +} +@section css { + + + + + + + + + + +} +@section javascript { + + + + + + + + + + + + + + + + +} +
+
+
+ lock avatar +

@Model.DisplayName

+ 系统已锁定 +
+ +
+
+ +
+ +
+
+
+
+
+
diff --git a/Bootstrap.Admin/wwwroot/css/lock.css b/Bootstrap.Admin/wwwroot/css/lock.css new file mode 100644 index 00000000..046792a0 --- /dev/null +++ b/Bootstrap.Admin/wwwroot/css/lock.css @@ -0,0 +1,113 @@ +.lock-screen { + background: #02bac6 url("images/lock-bg.jpg"); + background-size: cover; + background-repeat: repeat; +} + +.lock-wrapper { + margin: 6% auto; + max-width: 330px; +} + +.lock-box { + background: rgba(255,255,255,.3); + padding: 20px; + border-radius: 10px; + -webkit-border-radius: 10px; + position: relative; +} + + .lock-box .form-group { + float: inherit !important; + } + +.lock-wrapper img { + border-radius: 50%; + -webkit-border-radius: 50%; + border: 5px solid #28a745; + width: 250px; + height: 250px; +} + +.lock-wrapper h1 { + text-align: center; + color: #fff; + font-size: 18px; + text-transform: uppercase; + padding: 20px 0 0 0; +} + +.lock-wrapper .locked { + margin-bottom: 20px; + display: inline-block; + color: #026f7a; +} + +.btn-lock, .btn-lock:hover { + background: #02b5c2; + color: #fff; +} + +.lock-input { + width: 83%; + border: none; + float: left; + margin-right: 3px; +} + +#time { + width: 100%; + color: #fff; + font-size: 60px; + display: inline-block; + text-align: center; + font-family: 'Open Sans', sans-serif; + font-weight: 300; +} + +.btn-lock, .btn-lock:hover { + background: #02b5c2; + color: #fff; + outline: none !important; + border-left: none; +} + +.has-error .btn-lock { + color: #a94442; + background-color: #f2dede; + border-color: #a94442; +} + +.has-success .btn-lock { + color: #3c763d; + background-color: #dff0d8; + border-color: #3c763d; +} + +div.input-group span { + top: 0; + background: #02b5c2; + border-color: #2e6da4; + color: #fff; +} + +.form-inline .input-group input:focus { + z-index: auto; +} + +div.input-group input, div.input-group input:hover, .btn-lock { + border-color: #1d9238; +} + +div.input-group input:focus { + box-shadow: none; +} + +div.input-group input, div.input-group input:hover, div.input-group input:focus { + border-right: none; +} + + div.input-group input.error { + background-color: #dcc4c4; + border-color: #e21717; + } \ No newline at end of file diff --git a/Bootstrap.Admin/wwwroot/js/lock.js b/Bootstrap.Admin/wwwroot/js/lock.js new file mode 100644 index 00000000..ca02b45d --- /dev/null +++ b/Bootstrap.Admin/wwwroot/js/lock.js @@ -0,0 +1,12 @@ +$(function () { + $('body').addClass('lock-screen'); + $('#time').text((new Date()).format('HH:mm:ss')); + + setInterval(function () { + $('#time').text((new Date()).format('HH:mm:ss')); + }, 500); + + $.extend($.validator.messages, { required: "请输入密码" }); + + $(".lock-wrapper").autoCenter(); +}); From 4f48ad0d21267e7077c5111a4e5aa2c1ccbb9a1e Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Tue, 20 Aug 2019 18:12:07 +0800 Subject: [PATCH 2/6] =?UTF-8?q?style:=20=E4=BF=AE=E6=AD=A3=E8=83=8C?= =?UTF-8?q?=E6=99=AF=E5=9B=BE=E7=89=87=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bootstrap.Admin/wwwroot/css/lock.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bootstrap.Admin/wwwroot/css/lock.css b/Bootstrap.Admin/wwwroot/css/lock.css index 046792a0..b2f3d21d 100644 --- a/Bootstrap.Admin/wwwroot/css/lock.css +++ b/Bootstrap.Admin/wwwroot/css/lock.css @@ -1,5 +1,5 @@ .lock-screen { - background: #02bac6 url("images/lock-bg.jpg"); + background: #02bac6 url("../images/lock-bg.jpg"); background-size: cover; background-repeat: repeat; } From 8868b8384c930e09b4f24ee2ffee2b65541b1e7b Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Tue, 20 Aug 2019 18:12:33 +0800 Subject: [PATCH 3/6] =?UTF-8?q?doc:=20=E7=A7=BB=E5=8A=A8=E6=97=B6=E9=92=9F?= =?UTF-8?q?=E5=85=83=E7=B4=A0=E5=88=B0=E5=A4=B4=E5=83=8F=E6=A1=86=E4=B8=8A?= =?UTF-8?q?=E9=83=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bootstrap.Admin/Views/Account/Lock.cshtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bootstrap.Admin/Views/Account/Lock.cshtml b/Bootstrap.Admin/Views/Account/Lock.cshtml index 34bb4eb6..35995d64 100644 --- a/Bootstrap.Admin/Views/Account/Lock.cshtml +++ b/Bootstrap.Admin/Views/Account/Lock.cshtml @@ -34,8 +34,8 @@ }
-
+
lock avatar

@Model.DisplayName

系统已锁定 From d3b51bef2fbd852e15e35a5c89fde2ccdb356e08 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Tue, 20 Aug 2019 18:19:45 +0800 Subject: [PATCH 4/6] =?UTF-8?q?refactor:=20=E7=A7=BB=E9=99=A4js=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E8=AE=BE=E7=BD=AE=E6=A0=B7=E5=BC=8F=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bootstrap.Admin/Views/Account/Lock.cshtml | 11 +---------- Bootstrap.Admin/wwwroot/css/lock.css | 2 +- Bootstrap.Admin/wwwroot/js/lock.js | 3 --- 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/Bootstrap.Admin/Views/Account/Lock.cshtml b/Bootstrap.Admin/Views/Account/Lock.cshtml index 35995d64..8c2086e9 100644 --- a/Bootstrap.Admin/Views/Account/Lock.cshtml +++ b/Bootstrap.Admin/Views/Account/Lock.cshtml @@ -1,7 +1,7 @@ @model LockModel @{ ViewBag.Title = "系统登陆"; - Layout = "~/Views/Shared/_Layout.cshtml"; + Layout = "_Layout"; } @section css { @@ -12,25 +12,16 @@ - } @section javascript { - - - - - - - - }
diff --git a/Bootstrap.Admin/wwwroot/css/lock.css b/Bootstrap.Admin/wwwroot/css/lock.css index b2f3d21d..35eb5c71 100644 --- a/Bootstrap.Admin/wwwroot/css/lock.css +++ b/Bootstrap.Admin/wwwroot/css/lock.css @@ -1,4 +1,4 @@ -.lock-screen { +body { background: #02bac6 url("../images/lock-bg.jpg"); background-size: cover; background-repeat: repeat; diff --git a/Bootstrap.Admin/wwwroot/js/lock.js b/Bootstrap.Admin/wwwroot/js/lock.js index ca02b45d..6fbdd226 100644 --- a/Bootstrap.Admin/wwwroot/js/lock.js +++ b/Bootstrap.Admin/wwwroot/js/lock.js @@ -1,12 +1,9 @@ $(function () { - $('body').addClass('lock-screen'); $('#time').text((new Date()).format('HH:mm:ss')); setInterval(function () { $('#time').text((new Date()).format('HH:mm:ss')); }, 500); - $.extend($.validator.messages, { required: "请输入密码" }); - $(".lock-wrapper").autoCenter(); }); From 58f517b8bd527109ab1b6ee7477186729c8cbd0a Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Tue, 20 Aug 2019 18:35:56 +0800 Subject: [PATCH 5/6] =?UTF-8?q?db:=20=E5=A2=9E=E5=8A=A0=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E9=94=81=E5=B1=8F=E8=8F=9C=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bootstrap.Admin/BootstrapAdmin.db | Bin 94208 -> 94208 bytes DatabaseScripts/MongoDB/Navigations.js | 12 +++++++ DatabaseScripts/MySQL/initData.sql | 1 + DatabaseScripts/Postgresql/initData.sql | 1 + DatabaseScripts/SQLite/InitData.sql | 1 + DatabaseScripts/SqlServer/InitData.sql | 43 ++++++++++++------------ 6 files changed, 37 insertions(+), 21 deletions(-) diff --git a/Bootstrap.Admin/BootstrapAdmin.db b/Bootstrap.Admin/BootstrapAdmin.db index ed3dab6e202f6f6e4ed71da386f81a65ccb543bd..f3022eec64155405e31afa5fbf9ad54ca7538f7c 100644 GIT binary patch delta 104 zcmV-u0GI!O;01u-1&|v7zL6Y50lu+dq<;fK0!5PtfP(@8MY9nQxdA^tLJI&0B>^od z4;Kgz=d-)#yPxTlf#tD}8D?Q1W??OKWo%`3X>)0BZhkL8V`Fc1Zgek9Z)0mPUvp(_ KW-zmaf_&|uc_&T) delta 37 tcmZp8z}oPDb%HeG-ib2KjC(gGEU9O9WNMkr-q5^RP~aEi=9Z?Kw*VS24{iVe diff --git a/DatabaseScripts/MongoDB/Navigations.js b/DatabaseScripts/MongoDB/Navigations.js index e977128e..185c40d7 100644 --- a/DatabaseScripts/MongoDB/Navigations.js +++ b/DatabaseScripts/MongoDB/Navigations.js @@ -95,6 +95,18 @@ "IsResource": NumberInt(2), "Application": "0" }, + { + "_id": ObjectId("5bd7b8445fa31256f77e4a01"), + "ParentId": "0", + "Name": "系统锁屏", + "Order": NumberInt(25), + "Icon": "fa fa-television", + "Url": "~/Account/Lock", + "Category": "0", + "Target": "_self", + "IsResource": NumberInt(0), + "Application": "0" + }, { "_id": ObjectId("5bd7b8445fa31256f77e4b92"), "ParentId": "0", diff --git a/DatabaseScripts/MySQL/initData.sql b/DatabaseScripts/MySQL/initData.sql index 9ebbb379..532fe616 100644 --- a/DatabaseScripts/MySQL/initData.sql +++ b/DatabaseScripts/MySQL/initData.sql @@ -59,6 +59,7 @@ INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category, IsResourc 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, IsResource) VALUES (@@identity - 5, '保存网站设置', 60, 'fa fa-fa', 'saveUISettings', '0', 2); +INSERT INTO Navigations (ParentId, Name, `Order`, Icon, Url, Category) VALUES (0, '系统锁屏', 25, 'fa fa-television', '~/Account/Lock', '0'); 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); diff --git a/DatabaseScripts/Postgresql/initData.sql b/DatabaseScripts/Postgresql/initData.sql index 213ca3bf..f2807fb5 100644 --- a/DatabaseScripts/Postgresql/initData.sql +++ b/DatabaseScripts/Postgresql/initData.sql @@ -59,6 +59,7 @@ INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category 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], IsResource) VALUES (currval('navigations_id_seq') - 6, '保存网站设置', 60, 'fa fa-fa', 'saveUISettings', '0', 2); +INSERT INTO Navigations (ParentId, Name, "order", Icon, Url, Category) VALUES (0, '系统锁屏', 25, 'fa fa-television', '~/Account/Lock', '0'); 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); diff --git a/DatabaseScripts/SQLite/InitData.sql b/DatabaseScripts/SQLite/InitData.sql index 7f960b18..dc1b1f50 100644 --- a/DatabaseScripts/SQLite/InitData.sql +++ b/DatabaseScripts/SQLite/InitData.sql @@ -59,6 +59,7 @@ INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category 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], IsResource) VALUES (last_insert_rowid() - 5, '保存网站设置', 60, 'fa fa-fa', 'saveUISettings', '0', 2); +INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, '系统锁屏', 25, 'fa fa-television', '~/Account/Lock', '0'); 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); diff --git a/DatabaseScripts/SqlServer/InitData.sql b/DatabaseScripts/SqlServer/InitData.sql index 5587b0f5..a3f2f8ff 100644 --- a/DatabaseScripts/SqlServer/InitData.sql +++ b/DatabaseScripts/SqlServer/InitData.sql @@ -62,26 +62,27 @@ INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category 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 INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category], IsResource) VALUES (@@Identity - 5, N'保存网站设置', 60, 'fa fa-fa', 'saveUISettings', '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]) VALUES (0, N'系统锁屏', 25, N'fa fa-television', N'~/Account/Lock', N'0') +INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, N'返回前台', 30, N'fa fa-hand-o-left', N'~/Home/Index', N'0') +INSERT INTO [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]) 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]) 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]) 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); @@ -89,32 +90,32 @@ INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category 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]) 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]) 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'网站分析', 145, N'fa fa-line-chart', N'~/Admin/Analyse', 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]) VALUES (0, N'站内消息', 100, N'fa fa-envelope', N'~/Admin/Messages', N'0') +INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, N'任务管理', 110, N'fa fa fa-tasks', N'~/Admin/Tasks', N'0') +INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, N'通知管理', 120, N'fa fa-bell', N'~/Admin/Notifications', N'0') +INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, N'日志管理', 130, N'fa fa-gears', N'#', N'0') +INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (@@Identity, N'操作日志', 10, N'fa fa-edit', N'~/Admin/Logs', N'0') +INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (@@Identity - 1, N'登录日志', 20, N'fa fa-user-circle-o', N'~/Admin/Logins', N'0') +INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (@@Identity - 2, N'访问日志', 30, N'fa fa-bars', N'~/Admin/Traces', N'0') +INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, N'在线用户', 140, N'fa fa-users', N'~/Admin/Online', N'0') +INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, N'网站分析', 145, N'fa fa-line-chart', N'~/Admin/Analyse', N'0') +INSERT INTO [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 INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, N'健康检查', 155, N'fa fa-heartbeat', N'~/Admin/Healths', '0'); -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') +INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (0, N'工具集合', 160, N'fa fa-gavel', N'#', N'0') +INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (@@Identity, N'客户端测试', 10, N'fa fa-wrench', N'~/Admin/Mobile', N'0') +INSERT INTO [Navigations] ([ParentId], [Name], [Order], [Icon], [Url], [Category]) VALUES (@@Identity - 1, N'API文档', 10, N'fa fa-wrench', N'~/swagger', N'0') +INSERT INTO [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 GroupName = 'Admin' INSERT [dbo].[Groups] ([GroupCode], [GroupName], [Description]) VALUES ('001', 'Admin', N'系统默认组') From 44d049d471bc4c9798e308a5744654be286cfbc5 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Tue, 20 Aug 2019 18:39:28 +0800 Subject: [PATCH 6/6] =?UTF-8?q?test:=20=E5=A2=9E=E5=8A=A0=E9=94=81?= =?UTF-8?q?=E5=B1=8F=E9=A1=B5=E9=9D=A2=E7=9A=84=E5=8D=95=E5=85=83=E6=B5=8B?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Bootstrap.Admin/Controllers/SQLServer/AccountTest.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/UnitTest/Bootstrap.Admin/Controllers/SQLServer/AccountTest.cs b/UnitTest/Bootstrap.Admin/Controllers/SQLServer/AccountTest.cs index 77b37437..5e6c846d 100644 --- a/UnitTest/Bootstrap.Admin/Controllers/SQLServer/AccountTest.cs +++ b/UnitTest/Bootstrap.Admin/Controllers/SQLServer/AccountTest.cs @@ -82,5 +82,14 @@ namespace Bootstrap.Admin.Controllers.SqlServer var content = await r.Content.ReadAsStringAsync(); Assert.Contains("服务器拒绝处理您的请求", content); } + + [Fact] + public async void Lock_Ok() + { + var r = await Client.GetAsync("Lock"); + Assert.True(r.IsSuccessStatusCode); + var content = await r.Content.ReadAsStringAsync(); + Assert.Contains("系统锁屏", content); + } } }