fix: change expires_at to expired_date in get_apikey_user and add_apikey, fix getID missing parentheses
This commit is contained in:
parent
e089df99f7
commit
c42f39bc8b
@ -37,7 +37,7 @@ async def get_apikey_user(sor, apikey, client_ip):
|
|||||||
where a.userid = u.id
|
where a.userid = u.id
|
||||||
and b.id = a.dappid
|
and b.id = a.dappid
|
||||||
and a.apikey=${apikey}$
|
and a.apikey=${apikey}$
|
||||||
and a.expires_at > ${today}$"""
|
and a.expired_date > ${today}$"""
|
||||||
|
|
||||||
recs = await sor.sqlExe(sql, {"apikey":apikey, 'today': curDateString()})
|
recs = await sor.sqlExe(sql, {"apikey":apikey, 'today': curDateString()})
|
||||||
if len(recs) < 1:
|
if len(recs) < 1:
|
||||||
@ -190,7 +190,7 @@ async def add_user(sor, user):
|
|||||||
async def add_apikey(sor, dappid, dorgid, duserid, orgid, userid):
|
async def add_apikey(sor, dappid, dorgid, duserid, orgid, userid):
|
||||||
apikey = getID()
|
apikey = getID()
|
||||||
d = {
|
d = {
|
||||||
'id': getID,
|
'id': getID(),
|
||||||
'dappid': dappid,
|
'dappid': dappid,
|
||||||
'dorgid': dorgid,
|
'dorgid': dorgid,
|
||||||
'duserid': duserid,
|
'duserid': duserid,
|
||||||
@ -199,7 +199,7 @@ async def add_apikey(sor, dappid, dorgid, duserid, orgid, userid):
|
|||||||
'apikey': id,
|
'apikey': id,
|
||||||
'enabled': '1',
|
'enabled': '1',
|
||||||
'created_at': curDateString(),
|
'created_at': curDateString(),
|
||||||
'expires_at': '9999-12-31'
|
'expired_date': '9999-12-31'
|
||||||
}
|
}
|
||||||
await sor.C('downapikey', d)
|
await sor.C('downapikey', d)
|
||||||
return apikey
|
return apikey
|
||||||
@ -250,7 +250,7 @@ async def create_user_apikey(sor, dappid, user_id, user_orgid, **kwargs):
|
|||||||
'apikey': password_encode(apikey_value),
|
'apikey': password_encode(apikey_value),
|
||||||
'enabled': '1',
|
'enabled': '1',
|
||||||
'created_at': curDateString(),
|
'created_at': curDateString(),
|
||||||
'expires_at': '9999-12-31'
|
'expired_date': '9999-12-31'
|
||||||
}
|
}
|
||||||
|
|
||||||
await sor.C('downapikey', ns)
|
await sor.C('downapikey', ns)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user