From 4f88f7b782165c17ed914fb3c7739214539e4ecd Mon Sep 17 00:00:00 2001 From: falcon <9504402@qq.com> Date: Thu, 21 May 2020 11:16:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=9B=BF=E4=BB=A3jq?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FAuth/Controllers/ControllerBase.cs | 5 - FAuth/Models/CookieKeyDefine.cs | 17 --- FAuth/Startup.cs | 2 - FAuth/Views/Shared/_Layout.cshtml | 211 ++++++++++++++++------------ FAuth/Views/User/Login.cshtml | 6 +- FAuth/wwwroot/js/site.js | 24 ++-- 6 files changed, 135 insertions(+), 130 deletions(-) delete mode 100644 FAuth/Models/CookieKeyDefine.cs diff --git a/FAuth/Controllers/ControllerBase.cs b/FAuth/Controllers/ControllerBase.cs index 02407a2..e03c509 100644 --- a/FAuth/Controllers/ControllerBase.cs +++ b/FAuth/Controllers/ControllerBase.cs @@ -31,10 +31,6 @@ namespace FAuth.Controllers /// 数据缓冲 /// public ICacheProvider Cache { get; set; } - /// - /// Cookie中定义的键 - /// - public CookieKeyDefine CookieKeys { get; set; } /// /// 通过日志组件和服务集合生成控制器 @@ -46,7 +42,6 @@ namespace FAuth.Controllers this.Services = service; this.Db = service.GetService(); this.Cache = service.GetService(); - this.CookieKeys = Services.GetService>().Value; } } diff --git a/FAuth/Models/CookieKeyDefine.cs b/FAuth/Models/CookieKeyDefine.cs deleted file mode 100644 index f6cd58c..0000000 --- a/FAuth/Models/CookieKeyDefine.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Microsoft.Extensions.Options; - -namespace FAuth.Models -{ - /// - /// Cookie中使用的键定义 - /// - public class CookieKeyDefine:IOptions - { - public CookieKeyDefine Value => this; - - /// - /// 保存用户凭据的键 - /// - public string UserKey { get; set; } = "_userCK"; - } -} diff --git a/FAuth/Startup.cs b/FAuth/Startup.cs index 068b596..2400cd2 100644 --- a/FAuth/Startup.cs +++ b/FAuth/Startup.cs @@ -86,8 +86,6 @@ namespace FAuth services.AddUserTicketDryptor(UTDO); //עapi services.AddScoped(); - //עCookie - services.Configure(this.Configuration.GetSection("CookieKeyDefine")); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. diff --git a/FAuth/Views/Shared/_Layout.cshtml b/FAuth/Views/Shared/_Layout.cshtml index 95b032b..c7e55d7 100644 --- a/FAuth/Views/Shared/_Layout.cshtml +++ b/FAuth/Views/Shared/_Layout.cshtml @@ -1,6 +1,4 @@ -@using Microsoft.Extensions.Options -@inject IOptions CKD - + @@ -10,109 +8,140 @@ -
- +
- © 2020 - FAuth - 技术支持 +
+ @RenderBody() +
- + + + + + + @RenderSection("Scripts",required: false) diff --git a/FAuth/Views/User/Login.cshtml b/FAuth/Views/User/Login.cshtml index b936101..0e839dc 100644 --- a/FAuth/Views/User/Login.cshtml +++ b/FAuth/Views/User/Login.cshtml @@ -1,6 +1,4 @@ -@inject IOptions CKD - -
+
@@ -10,7 +8,7 @@