from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
s = Serializer(app.config['SECRET_KEY'], expires_in=3600) #令牌有效期60分钟
token = s.dumps({ 'confirm': 23 }) # 生成令牌
data = s.loads(token) #解析
# print(data) -> {'confirm': 23}
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
s = Serializer(app.config['SECRET_KEY'], expires_in=3600) #令牌有效期60分钟
token = s.dumps({ 'confirm': 23 }) # 生成令牌
data = s.loads(token) #解析
# print(data) -> {'confirm': 23}
本文标题:使用itsdangerous包生成签名令牌
本文链接:https://www.haomeiwen.com/subject/cqhbgftx.html
网友评论