修改账号token

This commit is contained in:
2024-12-20 14:54:11 +08:00
parent d165632cc8
commit 519eeb6df1
20 changed files with 167 additions and 166 deletions
+6 -6
View File
@@ -8,7 +8,7 @@ namespace IRaCIS.Core.Application.Auth
public interface ITokenService
{
string GetToken(IRaCISClaims user);
string GetToken(UserTokenInfo user);
}
@@ -21,16 +21,16 @@ namespace IRaCIS.Core.Application.Auth
_jwtSetting = option.Value;
}
public string GetToken(IRaCISClaims user)
public string GetToken(UserTokenInfo user)
{
//创建用户身份标识,可按需要添加更多信息
var claims = new Claim[]
{
new Claim(Microsoft.IdentityModel.JsonWebTokens.JwtRegisteredClaimNames.Jti, Guid.NewGuid().ToString()),
new Claim(JwtIRaCISClaimType.Id, user.Id.ToString()),
new Claim(JwtIRaCISClaimType.Name, user.FullName),
new Claim(JwtIRaCISClaimType.RealName, user.RealName),
new Claim(JwtIRaCISClaimType.Code,user.Code),
new Claim(JwtIRaCISClaimType.IdentityUserId, user.IdentityUserId.ToString()),
new Claim(JwtIRaCISClaimType.UserRoleId, user.UserRoleId.ToString()),
new Claim(JwtIRaCISClaimType.UserName, user.UserName),
new Claim(JwtIRaCISClaimType.FullName, user.FullName),
new Claim(JwtIRaCISClaimType.UserTypeId,user.UserTypeId.ToString()),
new Claim(JwtIRaCISClaimType.UserTypeEnum,user.UserTypeEnum.ToString()),
new Claim(JwtIRaCISClaimType.UserTypeEnumInt,((int)user.UserTypeEnum).ToString()),