diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/LoginController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/LoginController.cs index e304e84f4..b4896499b 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/LoginController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/LoginController.cs @@ -26,6 +26,7 @@ using Learun.Application.TwoDevelopment.PersonnelManagement; using Learun.Application.TwoDevelopment.Permission; using DotNetCasClient; using DotNetCasClient.Configuration; +using Learun.Loger; namespace Learun.Application.Web.Controllers { @@ -196,9 +197,10 @@ namespace Learun.Application.Web.Controllers public ActionResult Index() { #region CAS - + if (User.Identity.IsAuthenticated) { + string uid = User.Identity.Name; // 获取用户ID if (!string.IsNullOrEmpty(uid)) { @@ -227,6 +229,7 @@ namespace Learun.Application.Web.Controllers return Fail("系统无此用户,请先同步用户数据!"); } } + CasAuthentication.RedirectToLoginPage(); //LogHelper.WriteToLog("cas登录", $"无登录信息{Request.UrlReferrer}"); //LogHelper.WriteToLog("cas登录", $"信息{User.Identity.Name}"); @@ -272,6 +275,7 @@ namespace Learun.Application.Web.Controllers ////Response.Redirect(loginUrl); //return Redirect(loginUrl); #endregion + #region //string ticket = Request.QueryString["ticket"]; //string serviceUrl = DotNetCasClient.Configuration.CasClientConfiguration.CAS_SERVER_LOGIN_URL; @@ -389,6 +393,7 @@ namespace Learun.Application.Web.Controllers // default: // return View("Default"); // 经典版本 //} + #endregion return Fail("userinfo is null"); }