一、安装
pip3 install pyjwt
import jwt
import time
def get_token()
payloads = {
"iat": math.floor(int(time.time() * 1000) / (1000 * 3600)) * 3600,
"_appId": appid #应用id
}
headers = {'alg': 'HS256', 'typ': 'JWT'}
jwt_encode = jwt.encode(payloads, base.app_secret, headers=headers).encode('UTF-8').decode('UTF-8')
return jwt_encode