This commit is contained in:
yumoqing 2025-09-01 14:06:19 +08:00
parent 45643f1f2d
commit f67e19b405

View File

@ -61,12 +61,26 @@ async def get_userapikey(sor, upappid, callerid):
a.myappid, a.myappid,
a.ownerid as appownerid, a.ownerid as appownerid,
a.baseurl, a.baseurl,
b.apikey, a.secretkey,
a.secretkey b.apikey
from upapp a, upappkey b from upapp a left join
where a.id = b.upappid (select * from upappkey
and a.id = ${appid}$ where upappid=${appid}$
and b.ownerid = ${ownerid}$""" and ownerid = ${ownerid}$) b
on a.id = b.upappid
where a.id = ${appid}$"""
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.sqlExe(sql, {'appid':upappid, 'ownerid': callerid}) recs = await sor.sqlExe(sql, {'appid':upappid, 'ownerid': callerid})
if len(recs) < 1: if len(recs) < 1:
e = Exception(f'{upappid=}, {callerid=} has not apikey') e = Exception(f'{upappid=}, {callerid=} has not apikey')