From 4009b054d0bf40f34b43f3c2804e2bb68a53014b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=C2=B7=C3=A6?= <279202647@qq.com> Date: Fri, 22 Oct 2021 14:08:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9jwt=E5=9B=A2=E9=98=9Fid?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DependencyInjection/Operator.cs | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/Coldairarrow.Api/DependencyInjection/Operator.cs b/src/Coldairarrow.Api/DependencyInjection/Operator.cs index 9c73f54..edc75d0 100644 --- a/src/Coldairarrow.Api/DependencyInjection/Operator.cs +++ b/src/Coldairarrow.Api/DependencyInjection/Operator.cs @@ -26,19 +26,9 @@ namespace Coldairarrow.Api UserId = httpContextAccessor?.HttpContext?.User.Claims .Where(x => x.Type == "userId").FirstOrDefault()?.Value; + TeamId = httpContextAccessor?.HttpContext?.User.Claims + .Where(x => x.Type == "teamId").FirstOrDefault()?.Value; - if (string.IsNullOrEmpty(UserId)) - { - string json = httpContextAccessor?.HttpContext?.User.Claims - .Where(x => x.Type == "user").FirstOrDefault()?.Value; - if (!string.IsNullOrEmpty(json)) - { - var user = Newtonsoft.Json.JsonConvert.DeserializeObject(json); - - UserId = user.Id; - TeamId = user.TeamId; - } - } } private Base_UserDTO _property;