bugfix
This commit is contained in:
parent
54daa0415d
commit
8e65f5fc15
24
wwwroot/create_apikey.dspy
Normal file
24
wwwroot/create_apikey.dspy
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
debug(f'{params_kw=}')
|
||||||
|
dbname = get_module_dbname()
|
||||||
|
db = DBPools()
|
||||||
|
async with db.sqlorContext(dbname) as sor:
|
||||||
|
orgid = await get_userorgid()
|
||||||
|
userid = await get_user()
|
||||||
|
ns = {
|
||||||
|
"id": uuid(),
|
||||||
|
"name": params_kw.name,
|
||||||
|
"description": params_kw.description,
|
||||||
|
"secretkey": uuid(),
|
||||||
|
"allowedips": params_kw.allowips,
|
||||||
|
"orgid": orgid
|
||||||
|
}
|
||||||
|
await sor.C('downapp', ns)
|
||||||
|
ns1 = {
|
||||||
|
"id": uuid()
|
||||||
|
"dappid": ns['id'],
|
||||||
|
"userid": userid,
|
||||||
|
"apikey": uuid(),
|
||||||
|
"enabled_date": curDateString(),
|
||||||
|
"expired_date": '9999-12-31'
|
||||||
|
}
|
||||||
|
await sor.C('downapikey', ns1)
|
||||||
36
wwwroot/create_apikey.ui
Normal file
36
wwwroot/create_apikey.ui
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
{
|
||||||
|
"widgettype":"Form",
|
||||||
|
"options":{
|
||||||
|
"title":"创建用户apikey",
|
||||||
|
"dscription":"下位系统要免密登录本系统,需要设置apikey和secretkey",
|
||||||
|
"field":[
|
||||||
|
{
|
||||||
|
"name":"appname",
|
||||||
|
"label":"应用名",
|
||||||
|
"uitype":"str",
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name":"description",
|
||||||
|
"label":"应用描述",
|
||||||
|
"uitype":"str"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name":"allowedips",
|
||||||
|
"label":"允许的IP集",
|
||||||
|
"uitype":"str"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"binds":[
|
||||||
|
{
|
||||||
|
"wid":"self",
|
||||||
|
"evnet":"submit",
|
||||||
|
"actiontype":"urlwidget",
|
||||||
|
"target":"self",
|
||||||
|
"options":{
|
||||||
|
"url":"{{entire_url('./create_apikey.dspy')}}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user