From f67e19b405f30ff2d2e4b5d053ce88de775955a5 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Mon, 1 Sep 2025 14:06:19 +0800 Subject: [PATCH] bugfix --- uapi/appapi.py | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/uapi/appapi.py b/uapi/appapi.py index 34b6fab..d10bf9c 100644 --- a/uapi/appapi.py +++ b/uapi/appapi.py @@ -61,12 +61,26 @@ async def get_userapikey(sor, upappid, callerid): a.myappid, a.ownerid as appownerid, a.baseurl, -b.apikey, -a.secretkey -from upapp a, upappkey b -where a.id = b.upappid -and a.id = ${appid}$ -and b.ownerid = ${ownerid}$""" +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}$""" + 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}) if len(recs) < 1: e = Exception(f'{upappid=}, {callerid=} has not apikey')