bugfix
This commit is contained in:
parent
5e94ed35c2
commit
27c1c832b2
@ -6,18 +6,11 @@
|
||||
"confidential_fields":["secretkey"],
|
||||
"noedit":true,
|
||||
"browserfields": {
|
||||
"exclouded": ["id", "secretkey" ],
|
||||
"exclouded": ["id", "secretkey", "orgid" ],
|
||||
"alters": {}
|
||||
},
|
||||
"editexclouded": [
|
||||
|
||||
],
|
||||
"subtables": [
|
||||
{
|
||||
"field":"appid",
|
||||
"title":"apikey",
|
||||
"subtable":"downapikey"
|
||||
}
|
||||
],
|
||||
"toolbar":{
|
||||
"tools":[
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
debug(f'{params_kw=}')
|
||||
dbname = get_module_dbname()
|
||||
dbname = get_module_dbname('dapi')
|
||||
db = DBPools()
|
||||
async with db.sqlorContext(dbname) as sor:
|
||||
orgid = await get_userorgid()
|
||||
@ -19,5 +19,5 @@ where a.id = b.dappid
|
||||
recs = await sor.sqlExe(sql, ns)
|
||||
if len(recs):
|
||||
r = recs[0]
|
||||
return UiMessage(title="copy apikey", message=f'appid={r.id}, apikey={r.apikey} secretkey={r.secretkey}')
|
||||
return UiMessage(title="copy apikey", message=f"appid={r.id}, apikey={r.apikey} secretkey={r.secretkey}")
|
||||
return UiError(title='copy apikey', message='copy apikey error')
|
||||
|
||||
@ -1,20 +1,20 @@
|
||||
debug(f'{params_kw=}')
|
||||
dbname = get_module_dbname()
|
||||
dbname = get_module_dbname('dapi')
|
||||
db = DBPools()
|
||||
async with db.sqlorContext(dbname) as sor:
|
||||
orgid = await get_userorgid()
|
||||
userid = await get_user()
|
||||
ns = {
|
||||
"id": uuid(),
|
||||
"name": params_kw.name,
|
||||
"name": params_kw.appname,
|
||||
"description": params_kw.description,
|
||||
"secretkey": uuid(),
|
||||
"allowedips": params_kw.allowips,
|
||||
"allowedips": params_kw.allowedips,
|
||||
"orgid": orgid
|
||||
}
|
||||
await sor.C('downapp', ns)
|
||||
ns1 = {
|
||||
"id": uuid()
|
||||
"id": uuid(),
|
||||
"dappid": ns['id'],
|
||||
"userid": userid,
|
||||
"apikey": uuid(),
|
||||
@ -22,5 +22,5 @@ async with db.sqlorContext(dbname) as sor:
|
||||
"expired_date": '9999-12-31'
|
||||
}
|
||||
await sor.C('downapikey', ns1)
|
||||
return UiMessage(title="create apikey", message=f'appid={ns['id']}, apikey={ns1['apikey']}, secretkey={ns['secretkey'}')
|
||||
return UiMessage(title="create apikey", message=f"appid={ns['id']}, apikey={ns1['apikey']}, secretkey={ns['secretkey']}")
|
||||
return UiError(title='create apikey', message='add apikey error')
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
"options":{
|
||||
"title":"创建用户apikey",
|
||||
"dscription":"下位系统要免密登录本系统,需要设置apikey和secretkey",
|
||||
"field":[
|
||||
"fields":[
|
||||
{
|
||||
"name":"appname",
|
||||
"label":"应用名",
|
||||
@ -25,7 +25,7 @@
|
||||
"binds":[
|
||||
{
|
||||
"wid":"self",
|
||||
"evnet":"submit",
|
||||
"event":"submit",
|
||||
"actiontype":"urlwidget",
|
||||
"target":"self",
|
||||
"options":{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user