diff --git a/AMESCoreStudio.Web/Controllers/LoginController.cs b/AMESCoreStudio.Web/Controllers/LoginController.cs index f76006b6..0135f1da 100644 --- a/AMESCoreStudio.Web/Controllers/LoginController.cs +++ b/AMESCoreStudio.Web/Controllers/LoginController.cs @@ -126,7 +126,7 @@ namespace AMESCoreStudio.Web.Controllers HttpContext.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme, new ClaimsPrincipal(identity), new AuthenticationProperties { //获取或设置身份验证会话是否跨多个持久化要求 - IsPersistent = false, + IsPersistent = true, ExpiresUtc = null, //AllowRefresh = true, RedirectUri = "/Home/Framework" diff --git a/AMESCoreStudio.Web/Controllers/REPController.cs b/AMESCoreStudio.Web/Controllers/REPController.cs index 98b8a83d..3b53792c 100644 --- a/AMESCoreStudio.Web/Controllers/REPController.cs +++ b/AMESCoreStudio.Web/Controllers/REPController.cs @@ -14,6 +14,7 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Hosting; using AMESCoreStudio.WebApi.DTO.AMES; using Newtonsoft.Json.Linq; +using Microsoft.AspNetCore.Authentication.Cookies; namespace AMESCoreStudio.Web.Controllers { @@ -567,7 +568,10 @@ namespace AMESCoreStudio.Web.Controllers { IResultModel result; var userID = ""; - userID = HttpContext.Request.Cookies["UserID4REP001"]; + + //userID = HttpContext.Request.Cookies["UserID4REP001"]; + userID = User.FindFirst("UserID")?.Value; + //HttpContext.Request.Cookies.TryGetValue("UserID", out userID); int user_id = 0; if (userID != null)