def my_login_callback(self, **kwargs): d = r.get(self.wxbot_id) if d: data = eval(d) data['status'] = 'logined' r.set(self.wxbot_id, data) else: r.set(self.wxbot_id, {'status': 'logined'})
def change_wxxnr_redis_data(wxbot_id, xnr_data={}): d = r.get(wxbot_id) data = {} if d: data = eval(d) for key, value in xnr_data.items(): data[key] = value #如果存在key则更改数据为value,不存在key则增加数据value return r.set(wxbot_id, data)