def login(): user = get_logged_in_user(current_bot) from wechat.tasks import async_retrieve_data, listener async_retrieve_data.delay() listener.delay() sse.publish({'type': 'logged_in', 'user': user}, type='login') return {'msg': ''}
def login_wx(): bot_id, bot = mybot.create_bot() logger.info("微信登录完成") wxuser = get_logged_in_user(bot) from wechat.tasks import listener, retrieve_data listener.delay(bot_id) retrieve_data.delay(bot_id) return {"code": 600, "msg": "微信登录完成", "data": wxuser}
def get_wx(): r = [get_logged_in_user(bot) for bot in mybot.bots.values()] return {'code': 600, 'msg': "bot列表获取成功", 'data': r}
def login(): user = get_logged_in_user(current_bot) from wechat.tasks import async_retrieve_data async_retrieve_data.delay() sse.publish({'type': 'logged_in', 'user': user}, type='login') return {'msg': ''}