From a02a1474f5fe6afba30dcd31dead5c2dd0c68336 Mon Sep 17 00:00:00 2001 From: Argo Windows Date: Thu, 31 Oct 2019 12:25:18 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=99=BB=E5=BD=95=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=90=8D=E4=B8=8D=E5=AD=98=E5=9C=A8=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E5=88=B0=E4=B8=AD=E9=97=B4=E4=BB=B6=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/admin/Bootstrap.Admin/Controllers/HomeController.cs | 7 +------ src/admin/Bootstrap.DataAccess/Bootstrap.DataAccess.csproj | 2 +- .../Bootstrap.Client.DataAccess.csproj | 2 +- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/admin/Bootstrap.Admin/Controllers/HomeController.cs b/src/admin/Bootstrap.Admin/Controllers/HomeController.cs index 8b2796bc..82650990 100644 --- a/src/admin/Bootstrap.Admin/Controllers/HomeController.cs +++ b/src/admin/Bootstrap.Admin/Controllers/HomeController.cs @@ -18,12 +18,7 @@ namespace Bootstrap.Admin.Controllers /// public IActionResult Index() { - var userName = User.Identity.Name; - if (string.IsNullOrEmpty(userName)) return Redirect(Request.PathBase + CookieAuthenticationDefaults.LoginPath); - - var model = new HeaderBarModel(userName); - if (string.IsNullOrEmpty(model.UserName)) return Redirect(Request.PathBase + CookieAuthenticationDefaults.LogoutPath); - + var model = new HeaderBarModel(User.Identity.Name); var homeUrl = DictHelper.RetrieveHomeUrl(model.AppId); return homeUrl.Equals("~/Home/Index", System.StringComparison.OrdinalIgnoreCase) ? (IActionResult)View(model) : Redirect(homeUrl); } diff --git a/src/admin/Bootstrap.DataAccess/Bootstrap.DataAccess.csproj b/src/admin/Bootstrap.DataAccess/Bootstrap.DataAccess.csproj index 6286cad4..3cc79377 100644 --- a/src/admin/Bootstrap.DataAccess/Bootstrap.DataAccess.csproj +++ b/src/admin/Bootstrap.DataAccess/Bootstrap.DataAccess.csproj @@ -6,7 +6,7 @@ - + diff --git a/src/client/Bootstrap.Client.DataAccess/Bootstrap.Client.DataAccess.csproj b/src/client/Bootstrap.Client.DataAccess/Bootstrap.Client.DataAccess.csproj index 9c134c9f..d2b69649 100644 --- a/src/client/Bootstrap.Client.DataAccess/Bootstrap.Client.DataAccess.csproj +++ b/src/client/Bootstrap.Client.DataAccess/Bootstrap.Client.DataAccess.csproj @@ -6,7 +6,7 @@ - +