From 27e25c9907e4ffb9fd491e95fee3a033f46e760d Mon Sep 17 00:00:00 2001 From: Argo-Tianyi Date: Sat, 11 Dec 2021 14:24:36 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=9B=B4=E6=96=B0=E5=91=BD=E5=90=8D?= =?UTF-8?q?=E7=A9=BA=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BootstrapAdminContext.cs | 5 - .../Extensions/ServicesExtensions.cs | 3 +- .../Services/DictsService.cs | 2 +- .../Services/NavigationsService.cs | 3 +- .../Extensions/ServicesExtensions.cs | 2 +- .../Services/DictsService.cs | 2 +- .../Services/NavigationsService.cs | 2 +- .../BootstrapAdmin.Web.Core.csproj | 2 +- .../admin/BootstrapAdmin.Web.Core/IDicts.cs | 2 +- .../BootstrapAdmin.Web.Core/INavigations.cs | 2 +- .../Controllers/AccountController.cs | 413 +++++++++--------- .../Extensions/ServicesExtensions.cs | 1 - .../Shared/MainLayout.razor.cs | 2 +- .../Controllers/HomeController.cs | 1 - .../Pages/Components/EditPageBase.cs | 3 +- .../Pages/Components/HeaderBase.cs | 3 +- .../Pages/Components/LgbInputText.cs | 2 - .../Pages/Components/TableBase.cs | 1 - .../Pages/Views/Admin/RolesBase.cs | 1 - 19 files changed, 215 insertions(+), 237 deletions(-) diff --git a/src/blazor/admin/BootstrapAdmin.DataAccess.EFCore/BootstrapAdminContext.cs b/src/blazor/admin/BootstrapAdmin.DataAccess.EFCore/BootstrapAdminContext.cs index cd41767f..48ed7ed3 100644 --- a/src/blazor/admin/BootstrapAdmin.DataAccess.EFCore/BootstrapAdminContext.cs +++ b/src/blazor/admin/BootstrapAdmin.DataAccess.EFCore/BootstrapAdminContext.cs @@ -1,10 +1,5 @@ using BootstrapAdmin.DataAccess.Models; using Microsoft.EntityFrameworkCore; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace BootstrapAdmin.DataAccess.EFCore { diff --git a/src/blazor/admin/BootstrapAdmin.DataAccess.EFCore/Extensions/ServicesExtensions.cs b/src/blazor/admin/BootstrapAdmin.DataAccess.EFCore/Extensions/ServicesExtensions.cs index 9366aa21..9e31a096 100644 --- a/src/blazor/admin/BootstrapAdmin.DataAccess.EFCore/Extensions/ServicesExtensions.cs +++ b/src/blazor/admin/BootstrapAdmin.DataAccess.EFCore/Extensions/ServicesExtensions.cs @@ -1,10 +1,9 @@ using BootstrapAdmin.DataAccess.EFCore; using BootstrapAdmin.DataAccess.EFCore.Services; -using BootstrapAdmin.DataAccess.Interface; +using BootstrapAdmin.DataAccess.Core; using BootstrapBlazor.Components; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection.Extensions; namespace Microsoft.Extensions.DependencyInjection { diff --git a/src/blazor/admin/BootstrapAdmin.DataAccess.EFCore/Services/DictsService.cs b/src/blazor/admin/BootstrapAdmin.DataAccess.EFCore/Services/DictsService.cs index 71ddf4f5..790d0b39 100644 --- a/src/blazor/admin/BootstrapAdmin.DataAccess.EFCore/Services/DictsService.cs +++ b/src/blazor/admin/BootstrapAdmin.DataAccess.EFCore/Services/DictsService.cs @@ -1,4 +1,4 @@ -using BootstrapAdmin.DataAccess.Interface; +using BootstrapAdmin.DataAccess.Core; namespace BootstrapAdmin.DataAccess.EFCore.Services { diff --git a/src/blazor/admin/BootstrapAdmin.DataAccess.EFCore/Services/NavigationsService.cs b/src/blazor/admin/BootstrapAdmin.DataAccess.EFCore/Services/NavigationsService.cs index 8b06ed97..094fc3e9 100644 --- a/src/blazor/admin/BootstrapAdmin.DataAccess.EFCore/Services/NavigationsService.cs +++ b/src/blazor/admin/BootstrapAdmin.DataAccess.EFCore/Services/NavigationsService.cs @@ -1,5 +1,4 @@ -using BootstrapAdmin.DataAccess.EFCore; -using BootstrapAdmin.DataAccess.Interface; +using BootstrapAdmin.DataAccess.Core; using BootstrapAdmin.DataAccess.Models; using Microsoft.EntityFrameworkCore; diff --git a/src/blazor/admin/BootstrapAdmin.DataAccess.PetaPoco/Extensions/ServicesExtensions.cs b/src/blazor/admin/BootstrapAdmin.DataAccess.PetaPoco/Extensions/ServicesExtensions.cs index 0424b0e3..ff0a358d 100644 --- a/src/blazor/admin/BootstrapAdmin.DataAccess.PetaPoco/Extensions/ServicesExtensions.cs +++ b/src/blazor/admin/BootstrapAdmin.DataAccess.PetaPoco/Extensions/ServicesExtensions.cs @@ -1,4 +1,4 @@ -using BootstrapAdmin.DataAccess.Interface; +using BootstrapAdmin.DataAccess.Core; using BootstrapAdmin.DataAccess.PetaPoco; using BootstrapAdmin.DataAccess.PetaPoco.Services; using BootstrapBlazor.Components; diff --git a/src/blazor/admin/BootstrapAdmin.DataAccess.PetaPoco/Services/DictsService.cs b/src/blazor/admin/BootstrapAdmin.DataAccess.PetaPoco/Services/DictsService.cs index a833c742..7452a965 100644 --- a/src/blazor/admin/BootstrapAdmin.DataAccess.PetaPoco/Services/DictsService.cs +++ b/src/blazor/admin/BootstrapAdmin.DataAccess.PetaPoco/Services/DictsService.cs @@ -1,4 +1,4 @@ -using BootstrapAdmin.DataAccess.Interface; +using BootstrapAdmin.DataAccess.Core; namespace BootstrapAdmin.DataAccess.PetaPoco.Services { diff --git a/src/blazor/admin/BootstrapAdmin.DataAccess.PetaPoco/Services/NavigationsService.cs b/src/blazor/admin/BootstrapAdmin.DataAccess.PetaPoco/Services/NavigationsService.cs index 96214536..0a175bbe 100644 --- a/src/blazor/admin/BootstrapAdmin.DataAccess.PetaPoco/Services/NavigationsService.cs +++ b/src/blazor/admin/BootstrapAdmin.DataAccess.PetaPoco/Services/NavigationsService.cs @@ -1,4 +1,4 @@ -using BootstrapAdmin.DataAccess.Interface; +using BootstrapAdmin.DataAccess.Core; using BootstrapAdmin.DataAccess.Models; using PetaPoco; diff --git a/src/blazor/admin/BootstrapAdmin.Web.Core/BootstrapAdmin.Web.Core.csproj b/src/blazor/admin/BootstrapAdmin.Web.Core/BootstrapAdmin.Web.Core.csproj index 61d01683..6ac05ddc 100644 --- a/src/blazor/admin/BootstrapAdmin.Web.Core/BootstrapAdmin.Web.Core.csproj +++ b/src/blazor/admin/BootstrapAdmin.Web.Core/BootstrapAdmin.Web.Core.csproj @@ -1,4 +1,4 @@ - + diff --git a/src/blazor/admin/BootstrapAdmin.Web.Core/IDicts.cs b/src/blazor/admin/BootstrapAdmin.Web.Core/IDicts.cs index b321a8d0..c44cb0de 100644 --- a/src/blazor/admin/BootstrapAdmin.Web.Core/IDicts.cs +++ b/src/blazor/admin/BootstrapAdmin.Web.Core/IDicts.cs @@ -1,4 +1,4 @@ -namespace BootstrapAdmin.DataAccess.Interface +namespace BootstrapAdmin.DataAccess.Core { /// /// Dict 字典表接口 diff --git a/src/blazor/admin/BootstrapAdmin.Web.Core/INavigations.cs b/src/blazor/admin/BootstrapAdmin.Web.Core/INavigations.cs index 4655ab28..2270ddc7 100644 --- a/src/blazor/admin/BootstrapAdmin.Web.Core/INavigations.cs +++ b/src/blazor/admin/BootstrapAdmin.Web.Core/INavigations.cs @@ -1,6 +1,6 @@ using BootstrapAdmin.DataAccess.Models; -namespace BootstrapAdmin.DataAccess.Interface +namespace BootstrapAdmin.DataAccess.Core { /// /// diff --git a/src/blazor/admin/BootstrapAdmin.Web/Controllers/AccountController.cs b/src/blazor/admin/BootstrapAdmin.Web/Controllers/AccountController.cs index 7e74dd13..68a8072d 100644 --- a/src/blazor/admin/BootstrapAdmin.Web/Controllers/AccountController.cs +++ b/src/blazor/admin/BootstrapAdmin.Web/Controllers/AccountController.cs @@ -1,11 +1,4 @@ -using Microsoft.AspNetCore.Authentication; -using Microsoft.AspNetCore.Authentication.Cookies; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.WebUtilities; -using System.Security.Claims; - -namespace Bootstrap.Admin.Controllers +namespace Bootstrap.Admin.Controllers { ///// ///// Account controller. @@ -14,225 +7,225 @@ namespace Bootstrap.Admin.Controllers //[AutoValidateAntiforgeryToken] //public class AccountController : Controller //{ - //private const string MobileSchema = "Mobile"; - ///// - ///// 系统锁屏界面 - ///// - ///// - //[HttpGet] - //public async Task Lock() - //{ - // if (!User.Identity!.IsAuthenticated) return Login(); + //private const string MobileSchema = "Mobile"; + ///// + ///// 系统锁屏界面 + ///// + ///// + //[HttpGet] + //public async Task Lock() + //{ + // if (!User.Identity!.IsAuthenticated) return Login(); - // var authenticationType = User.Identity.AuthenticationType; - // await HttpContext.SignOutAsync(); - // var urlReferrer = Request.Headers["Referer"].FirstOrDefault(); - // if (urlReferrer?.Contains("/Pages", StringComparison.OrdinalIgnoreCase) ?? false) urlReferrer = "/Pages"; - // return View(new LockModel(User.Identity.Name) - // { - // AuthenticationType = authenticationType, - // ReturnUrl = WebUtility.UrlEncode(string.IsNullOrEmpty(urlReferrer) ? CookieAuthenticationDefaults.LoginPath.Value : urlReferrer) - // }); - //} + // var authenticationType = User.Identity.AuthenticationType; + // await HttpContext.SignOutAsync(); + // var urlReferrer = Request.Headers["Referer"].FirstOrDefault(); + // if (urlReferrer?.Contains("/Pages", StringComparison.OrdinalIgnoreCase) ?? false) urlReferrer = "/Pages"; + // return View(new LockModel(User.Identity.Name) + // { + // AuthenticationType = authenticationType, + // ReturnUrl = WebUtility.UrlEncode(string.IsNullOrEmpty(urlReferrer) ? CookieAuthenticationDefaults.LoginPath.Value : urlReferrer) + // }); + //} - ///// - ///// 系统锁屏界面 - ///// - ///// - ///// - ///// - ///// - ///// - //[HttpPost] - //[IgnoreAntiforgeryToken] - //public Task Lock([FromServices] ISMSProvider provider, string userName, string password, string authType) - //{ - // // 根据不同的登陆方式 - // Task ret; - // if (authType == MobileSchema) ret = Mobile(provider, userName, password); - // else ret = Login(userName, password, string.Empty); - // return ret; - //} + ///// + ///// 系统锁屏界面 + ///// + ///// + ///// + ///// + ///// + ///// + //[HttpPost] + //[IgnoreAntiforgeryToken] + //public Task Lock([FromServices] ISMSProvider provider, string userName, string password, string authType) + //{ + // // 根据不同的登陆方式 + // Task ret; + // if (authType == MobileSchema) ret = Mobile(provider, userName, password); + // else ret = Login(userName, password, string.Empty); + // return ret; + //} - ///// - ///// 系统登录方法 - ///// - ///// - ///// - ///// - //[HttpGet] - //public ActionResult Login([FromQuery] string? appId = null, [FromQuery] string view = "") - //{ - // if (DictHelper.RetrieveSystemModel()) - // { - // ViewBag.UserName = "Admin"; - // ViewBag.Password = "123789"; - // } - // return User.Identity!.IsAuthenticated ? (ActionResult)Redirect("~/Home/Index") : LoginView(view, new LoginModel(appId)); - //} + ///// + ///// 系统登录方法 + ///// + ///// + ///// + ///// + //[HttpGet] + //public ActionResult Login([FromQuery] string? appId = null, [FromQuery] string view = "") + //{ + // if (DictHelper.RetrieveSystemModel()) + // { + // ViewBag.UserName = "Admin"; + // ViewBag.Password = "123789"; + // } + // return User.Identity!.IsAuthenticated ? (ActionResult)Redirect("~/Home/Index") : LoginView(view, new LoginModel(appId)); + //} - //private ViewResult LoginView(string view, LoginModel model) - //{ - // if (string.IsNullOrEmpty(view)) - // { - // // retrieve login view from db - // view = DictHelper.RetrieveLoginView(); - // } - // return View(view, model); - //} + //private ViewResult LoginView(string view, LoginModel model) + //{ + // if (string.IsNullOrEmpty(view)) + // { + // // retrieve login view from db + // view = DictHelper.RetrieveLoginView(); + // } + // return View(view, model); + //} - ///// - ///// 短信验证登陆方法 - ///// - ///// - ///// - ///// - ///// - //[HttpPost()] - //public async Task Mobile([FromServices] ISMSProvider provider, string phone, string code) - //{ - // if (string.IsNullOrEmpty(phone) || string.IsNullOrEmpty(code)) return RedirectLogin(); + ///// + ///// 短信验证登陆方法 + ///// + ///// + ///// + ///// + ///// + //[HttpPost()] + //public async Task Mobile([FromServices] ISMSProvider provider, string phone, string code) + //{ + // if (string.IsNullOrEmpty(phone) || string.IsNullOrEmpty(code)) return RedirectLogin(); - // var auth = provider.Validate(phone, code); - // await HttpContext.Log(phone, auth); - // if (auth) - // { - // var user = UserHelper.Retrieves().FirstOrDefault(u => u.UserName == phone); - // if (user == null) - // { - // user = new User() - // { - // ApprovedBy = "Mobile", - // ApprovedTime = DateTime.Now, - // DisplayName = "手机用户", - // UserName = phone, - // Password = code, - // Icon = "default.jpg", - // Description = "手机用户", - // App = provider.Options.App - // }; - // if (UserHelper.Save(user) && !string.IsNullOrEmpty(user.Id)) - // { - // // 根据配置文件设置默认角色 - // var roles = RoleHelper.Retrieves().Where(r => provider.Options.Roles.Any(rl => rl.Equals(r.RoleName, StringComparison.OrdinalIgnoreCase))).Select(r => r.Id!); - // RoleHelper.SaveByUserId(user.Id, roles); - // } - // } - // } - // return auth ? await SignInAsync(phone, true, MobileSchema) : RedirectLogin(); - //} + // var auth = provider.Validate(phone, code); + // await HttpContext.Log(phone, auth); + // if (auth) + // { + // var user = UserHelper.Retrieves().FirstOrDefault(u => u.UserName == phone); + // if (user == null) + // { + // user = new User() + // { + // ApprovedBy = "Mobile", + // ApprovedTime = DateTime.Now, + // DisplayName = "手机用户", + // UserName = phone, + // Password = code, + // Icon = "default.jpg", + // Description = "手机用户", + // App = provider.Options.App + // }; + // if (UserHelper.Save(user) && !string.IsNullOrEmpty(user.Id)) + // { + // // 根据配置文件设置默认角色 + // var roles = RoleHelper.Retrieves().Where(r => provider.Options.Roles.Any(rl => rl.Equals(r.RoleName, StringComparison.OrdinalIgnoreCase))).Select(r => r.Id!); + // RoleHelper.SaveByUserId(user.Id, roles); + // } + // } + // } + // return auth ? await SignInAsync(phone, true, MobileSchema) : RedirectLogin(); + //} - //private IActionResult RedirectLogin() - //{ - // var query = Request.Query.Aggregate(new Dictionary(), (d, v) => - // { - // d.Add(v.Key, v.Value.ToString()); - // return d; - // }); - // return Redirect(QueryHelpers.AddQueryString(Request.PathBase + CookieAuthenticationDefaults.LoginPath, query)); - //} + //private IActionResult RedirectLogin() + //{ + // var query = Request.Query.Aggregate(new Dictionary(), (d, v) => + // { + // d.Add(v.Key, v.Value.ToString()); + // return d; + // }); + // return Redirect(QueryHelpers.AddQueryString(Request.PathBase + CookieAuthenticationDefaults.LoginPath, query)); + //} - ///// - ///// Login the specified userName, password and remember. - ///// - ///// The login. - ///// User name. - ///// Password. - ///// Remember. - //[HttpPost] - //public async Task Login(string userName, string password, string remember) - //{ - // if (string.IsNullOrEmpty(userName) || string.IsNullOrEmpty(password)) return RedirectLogin(); + ///// + ///// Login the specified userName, password and remember. + ///// + ///// The login. + ///// User name. + ///// Password. + ///// Remember. + //[HttpPost] + //public async Task Login(string userName, string password, string remember) + //{ + // if (string.IsNullOrEmpty(userName) || string.IsNullOrEmpty(password)) return RedirectLogin(); - // var auth = UserHelper.Authenticate(userName, password); - // await HttpContext.Log(userName, auth); - // return auth ? await SignInAsync(userName, remember == "true") : LoginView("", new LoginModel() { AuthFailed = true }); - //} + // var auth = UserHelper.Authenticate(userName, password); + // await HttpContext.Log(userName, auth); + // return auth ? await SignInAsync(userName, remember == "true") : LoginView("", new LoginModel() { AuthFailed = true }); + //} - //private async Task SignInAsync(string userName, bool persistent, string authenticationScheme = CookieAuthenticationDefaults.AuthenticationScheme) - //{ - // var identity = new ClaimsIdentity(authenticationScheme); - // identity.AddClaim(new Claim(ClaimTypes.Name, userName)); - // await HttpContext.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme, new ClaimsPrincipal(identity), new AuthenticationProperties { ExpiresUtc = DateTimeOffset.Now.AddDays(DictHelper.RetrieveCookieExpiresPeriod()), IsPersistent = persistent }); + //private async Task SignInAsync(string userName, bool persistent, string authenticationScheme = CookieAuthenticationDefaults.AuthenticationScheme) + //{ + // var identity = new ClaimsIdentity(authenticationScheme); + // identity.AddClaim(new Claim(ClaimTypes.Name, userName)); + // await HttpContext.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme, new ClaimsPrincipal(identity), new AuthenticationProperties { ExpiresUtc = DateTimeOffset.Now.AddDays(DictHelper.RetrieveCookieExpiresPeriod()), IsPersistent = persistent }); - // // redirect origin url - // var originUrl = Request.Query[CookieAuthenticationDefaults.ReturnUrlParameter].FirstOrDefault() ?? "~/Home/Index"; - // return Redirect(originUrl); - //} + // // redirect origin url + // var originUrl = Request.Query[CookieAuthenticationDefaults.ReturnUrlParameter].FirstOrDefault() ?? "~/Home/Index"; + // return Redirect(originUrl); + //} - ///// - ///// Logout this instance. - ///// - ///// - ///// The logout. - //[HttpGet] - //public async Task Logout([FromQuery] string appId) - //{ - // await HttpContext.SignOutAsync(); - // return Redirect(QueryHelpers.AddQueryString(Request.PathBase + CookieAuthenticationDefaults.LoginPath, "AppId", appId ?? BootstrapAppContext.AppId)); - //} + ///// + ///// Logout this instance. + ///// + ///// + ///// The logout. + //[HttpGet] + //public async Task Logout([FromQuery] string appId) + //{ + // await HttpContext.SignOutAsync(); + // return Redirect(QueryHelpers.AddQueryString(Request.PathBase + CookieAuthenticationDefaults.LoginPath, "AppId", appId ?? BootstrapAppContext.AppId)); + //} - ///// - ///// Accesses the denied. - ///// - ///// The denied. - //[ResponseCache(Duration = 600)] - //[HttpGet] - //public ActionResult AccessDenied() => View("Error", ErrorModel.CreateById(403)); + ///// + ///// Accesses the denied. + ///// + ///// The denied. + //[ResponseCache(Duration = 600)] + //[HttpGet] + //public ActionResult AccessDenied() => View("Error", ErrorModel.CreateById(403)); - ///// - ///// Gitee 认证 - ///// - ///// - //[HttpGet] - //public IActionResult Gitee([FromServices] IConfiguration config) - //{ - // var enabled = config.GetValue($"{nameof(GiteeOptions)}:Enabled", false); - // return Challenge(enabled ? GiteeDefaults.AuthenticationScheme : CookieAuthenticationDefaults.AuthenticationScheme); - //} + ///// + ///// Gitee 认证 + ///// + ///// + //[HttpGet] + //public IActionResult Gitee([FromServices] IConfiguration config) + //{ + // var enabled = config.GetValue($"{nameof(GiteeOptions)}:Enabled", false); + // return Challenge(enabled ? GiteeDefaults.AuthenticationScheme : CookieAuthenticationDefaults.AuthenticationScheme); + //} - ///// - ///// GitHub 认证 - ///// - ///// - //[HttpGet] - //public IActionResult GitHub([FromServices] IConfiguration config) - //{ - // var enabled = config.GetValue($"{nameof(GitHubOptions)}:Enabled", false); - // return Challenge(enabled ? GitHubDefaults.AuthenticationScheme : CookieAuthenticationDefaults.AuthenticationScheme); - //} + ///// + ///// GitHub 认证 + ///// + ///// + //[HttpGet] + //public IActionResult GitHub([FromServices] IConfiguration config) + //{ + // var enabled = config.GetValue($"{nameof(GitHubOptions)}:Enabled", false); + // return Challenge(enabled ? GitHubDefaults.AuthenticationScheme : CookieAuthenticationDefaults.AuthenticationScheme); + //} - ///// - ///// Tencent 认证 - ///// - ///// - //[HttpGet] - //public IActionResult Tencent([FromServices] IConfiguration config) - //{ - // var enabled = config.GetValue($"{nameof(TencentOptions)}:Enabled", false); - // return Challenge(enabled ? TencentDefaults.AuthenticationScheme : CookieAuthenticationDefaults.AuthenticationScheme); - //} + ///// + ///// Tencent 认证 + ///// + ///// + //[HttpGet] + //public IActionResult Tencent([FromServices] IConfiguration config) + //{ + // var enabled = config.GetValue($"{nameof(TencentOptions)}:Enabled", false); + // return Challenge(enabled ? TencentDefaults.AuthenticationScheme : CookieAuthenticationDefaults.AuthenticationScheme); + //} - ///// - ///// Alipay 认证 - ///// - ///// - //[HttpGet] - //public IActionResult Alipay([FromServices] IConfiguration config) - //{ - // var enabled = config.GetValue($"{nameof(AlipayOptions)}:Enabled", false); - // return Challenge(enabled ? AlipayDefaults.AuthenticationScheme : CookieAuthenticationDefaults.AuthenticationScheme); - //} + ///// + ///// Alipay 认证 + ///// + ///// + //[HttpGet] + //public IActionResult Alipay([FromServices] IConfiguration config) + //{ + // var enabled = config.GetValue($"{nameof(AlipayOptions)}:Enabled", false); + // return Challenge(enabled ? AlipayDefaults.AuthenticationScheme : CookieAuthenticationDefaults.AuthenticationScheme); + //} - ///// - ///// WeChat 认证 - ///// - ///// - //[HttpGet] - //public IActionResult WeChat([FromServices] IConfiguration config) - //{ - // var enabled = config.GetValue($"{nameof(WeChatOptions)}:Enabled", false); - // return Challenge(enabled ? WeChatDefaults.AuthenticationScheme : CookieAuthenticationDefaults.AuthenticationScheme); - //} + ///// + ///// WeChat 认证 + ///// + ///// + //[HttpGet] + //public IActionResult WeChat([FromServices] IConfiguration config) + //{ + // var enabled = config.GetValue($"{nameof(WeChatOptions)}:Enabled", false); + // return Challenge(enabled ? WeChatDefaults.AuthenticationScheme : CookieAuthenticationDefaults.AuthenticationScheme); + //} //} } diff --git a/src/blazor/admin/BootstrapAdmin.Web/Extensions/ServicesExtensions.cs b/src/blazor/admin/BootstrapAdmin.Web/Extensions/ServicesExtensions.cs index 7f46e5b4..b302786b 100644 --- a/src/blazor/admin/BootstrapAdmin.Web/Extensions/ServicesExtensions.cs +++ b/src/blazor/admin/BootstrapAdmin.Web/Extensions/ServicesExtensions.cs @@ -1,5 +1,4 @@ using BootstrapAdmin.Web.Services; -using BootstrapBlazor.DataAcces.PetaPoco; using System.Text; namespace Microsoft.Extensions.DependencyInjection diff --git a/src/blazor/admin/BootstrapAdmin.Web/Shared/MainLayout.razor.cs b/src/blazor/admin/BootstrapAdmin.Web/Shared/MainLayout.razor.cs index bb5878da..aa0838e3 100644 --- a/src/blazor/admin/BootstrapAdmin.Web/Shared/MainLayout.razor.cs +++ b/src/blazor/admin/BootstrapAdmin.Web/Shared/MainLayout.razor.cs @@ -1,4 +1,4 @@ -using BootstrapAdmin.DataAccess.Interface; +using BootstrapAdmin.DataAccess.Core; using BootstrapAdmin.Web.Extensions; namespace BootstrapAdmin.Web.Shared diff --git a/src/mvc/admin/Bootstrap.Admin/Controllers/HomeController.cs b/src/mvc/admin/Bootstrap.Admin/Controllers/HomeController.cs index c65bb588..97ec1ed1 100644 --- a/src/mvc/admin/Bootstrap.Admin/Controllers/HomeController.cs +++ b/src/mvc/admin/Bootstrap.Admin/Controllers/HomeController.cs @@ -3,7 +3,6 @@ using Bootstrap.DataAccess; using Microsoft.AspNetCore.Authentication.Cookies; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Configuration; namespace Bootstrap.Admin.Controllers { diff --git a/src/mvc/admin/Bootstrap.Admin/Pages/Components/EditPageBase.cs b/src/mvc/admin/Bootstrap.Admin/Pages/Components/EditPageBase.cs index f7ae0333..ecb97f2b 100644 --- a/src/mvc/admin/Bootstrap.Admin/Pages/Components/EditPageBase.cs +++ b/src/mvc/admin/Bootstrap.Admin/Pages/Components/EditPageBase.cs @@ -1,5 +1,4 @@ -using Bootstrap.Admin.Pages.Shared; -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; using System; using System.Collections.Generic; diff --git a/src/mvc/admin/Bootstrap.Admin/Pages/Components/HeaderBase.cs b/src/mvc/admin/Bootstrap.Admin/Pages/Components/HeaderBase.cs index d09191bb..9d0c0a8d 100644 --- a/src/mvc/admin/Bootstrap.Admin/Pages/Components/HeaderBase.cs +++ b/src/mvc/admin/Bootstrap.Admin/Pages/Components/HeaderBase.cs @@ -1,5 +1,4 @@ -using Bootstrap.Admin.Pages.Extensions; -using Bootstrap.Admin.Pages.Shared; +using Bootstrap.Admin.Pages.Shared; using Bootstrap.DataAccess; using Microsoft.AspNetCore.Components; diff --git a/src/mvc/admin/Bootstrap.Admin/Pages/Components/LgbInputText.cs b/src/mvc/admin/Bootstrap.Admin/Pages/Components/LgbInputText.cs index e07e3daf..fd85dac0 100644 --- a/src/mvc/admin/Bootstrap.Admin/Pages/Components/LgbInputText.cs +++ b/src/mvc/admin/Bootstrap.Admin/Pages/Components/LgbInputText.cs @@ -1,5 +1,3 @@ -using Bootstrap.Admin.Pages.Shared; - namespace Bootstrap.Admin.Pages.Components { /// diff --git a/src/mvc/admin/Bootstrap.Admin/Pages/Components/TableBase.cs b/src/mvc/admin/Bootstrap.Admin/Pages/Components/TableBase.cs index 23f0cc1e..e38f63f9 100644 --- a/src/mvc/admin/Bootstrap.Admin/Pages/Components/TableBase.cs +++ b/src/mvc/admin/Bootstrap.Admin/Pages/Components/TableBase.cs @@ -1,5 +1,4 @@ using Bootstrap.Admin.Pages.Extensions; -using Bootstrap.Admin.Pages.Shared; using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Forms; using Microsoft.JSInterop; diff --git a/src/mvc/admin/Bootstrap.Admin/Pages/Views/Admin/RolesBase.cs b/src/mvc/admin/Bootstrap.Admin/Pages/Views/Admin/RolesBase.cs index 9d628837..035728ea 100644 --- a/src/mvc/admin/Bootstrap.Admin/Pages/Views/Admin/RolesBase.cs +++ b/src/mvc/admin/Bootstrap.Admin/Pages/Views/Admin/RolesBase.cs @@ -1,5 +1,4 @@ using Bootstrap.Admin.Pages.Components; -using Bootstrap.Admin.Pages.Shared; using Bootstrap.DataAccess; using Microsoft.AspNetCore.Components; using Microsoft.JSInterop;