php-jwt库下载地址:https://github.com/firebase/php-jwt
$key = "localhost"; //秘钥加密关键 Signature
$token = array(
); //Payload
$jwt = JWT::encode($token, $key); //此处行进加密算法生成jwt
// $decoded = JWT::decode($jwt, $key, array('HS256'));//进行解密算法
文章来源: ThinkPHP5 php-jwt