在 Python 使用 JWT 主要的方案是 PyJWT 工具。
安装与基本使用
可以使用 pip 安装 PyJWT:
$ pip install pyjwt
编码与解码
编码函数
def encode( self, payload: Dict[str, Any], # payload 参数 key: str, # 秘钥 algorithm