UserManager新增分部类,定义访问令牌,用于定时任务解析当前登录用户信息
This commit is contained in:
@@ -3,13 +3,16 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Reflection;
|
||||
using System.Security.Claims;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Aspose.Cells.Drawing;
|
||||
using JNPF;
|
||||
using JNPF.Common.Contracts;
|
||||
using JNPF.Common.Core.Manager;
|
||||
using JNPF.Common.Enums;
|
||||
using JNPF.Common.Extension;
|
||||
using JNPF.DataEncryption;
|
||||
using JNPF.DependencyInjection;
|
||||
using JNPF.DynamicApiController;
|
||||
using JNPF.Systems.Interfaces.System;
|
||||
@@ -49,6 +52,19 @@ namespace Tnb.WarehouseMgr
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected Task<ClaimsPrincipal> GetUserIdentity()
|
||||
{
|
||||
var claims = JWTEncryption.ReadJwtToken(UserManager.AsscessToken)?.Claims;
|
||||
ClaimsIdentity toKen = new ClaimsIdentity();
|
||||
foreach (Claim item in claims)
|
||||
{
|
||||
toKen.AddClaim(item);
|
||||
}
|
||||
var curUser = new ClaimsPrincipal(toKen);
|
||||
return Task.FromResult(curUser);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 判断最终目标库位是否可以放置当前载具
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user