diff --git a/uapi/appapi.py b/uapi/appapi.py index afccb68..c7d6a5b 100644 --- a/uapi/appapi.py +++ b/uapi/appapi.py @@ -57,25 +57,13 @@ async def get_userapikey(sor, upappid, callerid): None: this orgid has not gotton apikey from upapp dict if apikey and upapp infos """ - sql = """select -a.myappid, -a.ownerid as appownerid, -a.baseurl, -a.secretkey, -b.apikey -from upapp a left join - (select * from upappkey - where upappid=${appid}$ - and ownerid = ${ownerid}$) b - on a.id = b.upappid -where a.id = ${appid}$""" recs = await sor.R('upapp', {'id': upappid}) if len(recs) < 1: e = Exception(f'upapp id={upappid} not found, result={recs}') exception(f'{e}, {format_exc()}') raise e r = recs[0] - apikeys = sor.R('upappkey', {'upappid': upappid, 'ownerid': callerid}) + apikeys = await sor.R('upappkey', {'upappid': upappid, 'ownerid': callerid}) if len(apikeys) > 0: r.apikey = apikeys[0].apikey else: