base.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:reversi-ai-place 作者: naari3 项目源码 文件源码
def get_current_user(self):
        sid = self.get_secure_cookie("sid")
        if not sid:
            return None
        sid = sid.decode('utf-8')
        session = Session(self.application.session_store, sid)
        if not session.data:
            return None
        if session.data.get('twitter_id'):
            user = User.get(twitter_id=session.data['twitter_id'])
        else:
            return None

        return user
        # return tornado.escape.json_decode(sid)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号