From f9276f10b953c152b269f40fcfc3f2f6053051e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com> Date: Tue, 19 Dec 2023 17:45:17 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20fix=20signalr=E5=90=91=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=8F=91=E9=80=81=E6=B6=88=E6=81=AF=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=20link=20https://gitee.com/izory/ZrAdminNetCore/issues/I8NZA1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Infrastructure/JwtUtil.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Infrastructure/JwtUtil.cs b/Infrastructure/JwtUtil.cs index 4edc598..b9bac64 100644 --- a/Infrastructure/JwtUtil.cs +++ b/Infrastructure/JwtUtil.cs @@ -155,10 +155,11 @@ namespace Infrastructure { var claims = new List() { - new Claim(ClaimTypes.PrimarySid, user.UserId.ToString()), - new Claim(ClaimTypes.Name, user.UserName), - new Claim(ClaimTypes.GroupSid, user.DeptId.ToString()), - new Claim(ClaimTypes.UserData, JsonConvert.SerializeObject(user)) + new(ClaimTypes.PrimarySid, user.UserId.ToString()), + new(ClaimTypes.NameIdentifier, user.UserId.ToString()), + new(ClaimTypes.Name, user.UserName), + new(ClaimTypes.GroupSid, user.DeptId.ToString()), + new(ClaimTypes.UserData, JsonConvert.SerializeObject(user)) }; return claims;