From 0fb0f17319ecf71d66b96a6acfd07f754be9443e Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期四, 24 十月 2024 13:44:38 +0800
Subject: [PATCH] WCS添加穿梭车信息表,修改任务信息表
---
项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Authorization/JwtHelper.cs | 27 +++++++++++++++------------
1 files changed, 15 insertions(+), 12 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Authorization/JwtHelper.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Authorization/JwtHelper.cs"
index 2669558..2ac124b 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Authorization/JwtHelper.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Authorization/JwtHelper.cs"
@@ -23,22 +23,23 @@
public static string IssueJwt(TokenModelJwt tokenModel)
{
string exp = $"{new DateTimeOffset(DateTime.Now.AddMinutes(/*tokenModel.UserId == 1 ? 43200 : */AppSettings.app("ExpMinutes").ObjToInt())).ToUnixTimeSeconds()}";
- var claims = new List<Claim>
+ List<Claim> claims = new List<Claim>
{
- new Claim(JwtRegisteredClaimNames.Jti,tokenModel.UserId.ToString()),
- new Claim(JwtRegisteredClaimNames.Iat, $"{new DateTimeOffset(DateTime.Now).ToUnixTimeSeconds()}"),
- new Claim(JwtRegisteredClaimNames.Nbf,$"{new DateTimeOffset(DateTime.Now).ToUnixTimeSeconds()}") ,
- //JWT杩囨湡鏃堕棿
- //榛樿璁剧疆jwt杩囨湡鏃堕棿120鍒嗛挓
- new Claim (JwtRegisteredClaimNames.Exp,exp),
- new Claim(JwtRegisteredClaimNames.Iss,AppSecret.Issuer),
- new Claim(JwtRegisteredClaimNames.Aud,AppSecret.Audience),
- new Claim(ClaimTypes.Role, tokenModel.RoleId.ToString())
+ new Claim(JwtRegisteredClaimNames.Jti, tokenModel.UserId.ToString()),
+ new Claim(JwtRegisteredClaimNames.Iat, $"{new DateTimeOffset(DateTime.Now).ToUnixTimeSeconds()}"),
+ new Claim(JwtRegisteredClaimNames.Nbf, $"{new DateTimeOffset(DateTime.Now).ToUnixTimeSeconds()}") ,
+ //JWT杩囨湡鏃堕棿
+ //榛樿璁剧疆jwt杩囨湡鏃堕棿120鍒嗛挓
+ new Claim (JwtRegisteredClaimNames.Exp, exp),
+ new Claim(JwtRegisteredClaimNames.Iss, AppSecret.Issuer),
+ new Claim(JwtRegisteredClaimNames.Aud, AppSecret.Audience),
+ new Claim(ClaimTypes.Role, tokenModel.RoleId.ToString()),
+ new Claim(ClaimTypes.Name, tokenModel.UserName),
+ new Claim(nameof(TokenModelJwt.TenantId), tokenModel.TenantId.ToString())
};
// 鍙互灏嗕竴涓敤鎴风殑澶氫釜瑙掕壊鍏ㄩ儴璧嬩簣锛�
// 浣滆�咃細DX 鎻愪緵鎶�鏈敮鎸侊紱
-
//绉橀挜16浣�
var key = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(AppSecret.JWT));
var creds = new SigningCredentials(key, SecurityAlgorithms.HmacSha256);
@@ -112,7 +113,9 @@
/// <summary>
/// 鑱岃兘
/// </summary>
- public string Work { get; set; }
+ public string UserName { get; set; }
+
+ public long TenantId { get; set; }
}
}
--
Gitblit v1.9.3