async def get_code_state(ns={}): if not ns: return { 'status': False, 'msg': 'There need params, but get none' } code_info = { 'id': ns.get('state') } db = DBPools() async with db.sqlorContext('kboss') as sor: try: res = await sor.R('wechat_login_code', code_info) if res: return { 'status': True, 'msg': '获取信息成功', 'code': res[0]['code'] } else: return { 'status': False, 'msg': '用户待扫码确认' } except Exception as e: return { 'status': False, 'msg': str(e) } ret = await get_code_state(params_kw) return ret