生成token

    // 失效日期 Date expiresAt = new Date(System.currentTimeMillis()+EXPIRE_TIME); String token = JWT.create() . .withIssuer(“auth0”) .withClaim(“username”,user.getUsername()) .withExpiresAt(expiresAt) // 使用了HMAC256加密算法 .sign(Algorithm.HMAC256(TOKEN_SECRET));