添加nuget-jwt引用:https://www.nuget.org/packages/JWT/
public class TokenInfo
{
public TokenInfo()
{
iss = "COM.Web";
iat = (DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalSeconds;
exp = iat + 300;
aud = "";
sub = "COM.Web";
jti = "COM.Web." + DateTime.Now.ToString("yyyyMMddhhmmssfff");
}
/// <summary>
/// jwt签发者
/// </summary>
public string iss { get; set; }
/// <summary>
/// jwt的签发时间
/// </summary>
public double iat { get; set; }
/// <summary>
/// jwt的过期时间,这个过期时间必须要大于签发时间
/// </summary>
public double exp { get; set; }
/// <summary>