This commit is contained in:
yumoqing 2025-09-01 14:34:42 +08:00
parent 4a9fc801ab
commit 480a01d7cf

View File

@ -69,12 +69,18 @@ from upapp a left join
and ownerid = ${ownerid}$) b and ownerid = ${ownerid}$) b
on a.id = b.upappid on a.id = b.upappid
where a.id = ${appid}$""" where a.id = ${appid}$"""
recs = await sor.sqlExe(sql, {'appid':upappid, 'ownerid': callerid}) recs = await sor.R('upapp', {'id': upappid})
if len(recs) < 1: if len(recs) < 1:
e = Exception(f'{upappid=}, {callerid=} has not apikey') e = Exception(f'{upappid=}, {callerid=} has not apikey')
exception(f'{e}, {format_exc()}') exception(f'{e}, {format_exc()}')
raise e raise e
r = recs[0] r = recs[0]
apikeys = sor.R('upappkey', {'upappid': upappid, 'ownerid': callerid})
if len(apikeys) > 0:
r.apikey = apikeys[0].apikey
else:
debug(f'-------user({callerid}) has not upappkey -----')
r = recs[0]
debug(f'{r=}') debug(f'{r=}')
return DictObject(**{ return DictObject(**{
'apikey':password_decode(r.apikey), 'apikey':password_decode(r.apikey),