bugfix
This commit is contained in:
parent
b025495d4e
commit
93eb1cbb01
@ -43,7 +43,7 @@ def get_apikey_from_token(token):
|
||||
return None
|
||||
|
||||
async def get_user_roles(userid):
|
||||
sql = "select concat(b.orgtypeid, '.' b.name) as name from userrole a, role b where a.userid=${userid}$ and a.roleid = b.id"
|
||||
sql = "select concat(b.orgtypeid, '.', b.name) as name from userrole a, role b where a.userid=${userid}$ and a.roleid = b.id"
|
||||
db = DBPools()
|
||||
roles = []
|
||||
dbname = await get_dbname()
|
||||
|
27
wwwroot/user/myrole.ui
Normal file
27
wwwroot/user/myrole.ui
Normal file
@ -0,0 +1,27 @@
|
||||
{
|
||||
"widgettype":"VBox",
|
||||
"options":{
|
||||
"height":"100%"
|
||||
},
|
||||
"subwidgets":[
|
||||
{
|
||||
"widgettype":"Title4",
|
||||
"options":{
|
||||
"otext":"我的角色",
|
||||
"i18n":true
|
||||
}
|
||||
},
|
||||
{% set roles = get_user_roles(get_user()) %}
|
||||
{% for role in roles %}
|
||||
{
|
||||
"widgettype":"Text",
|
||||
"options":{
|
||||
"text":"{{role}}"
|
||||
}
|
||||
},
|
||||
{% endfor %}
|
||||
{
|
||||
"oops":true
|
||||
}
|
||||
]
|
||||
}
|
@ -3,7 +3,7 @@
|
||||
"widgettype":"HBox",
|
||||
"options":{
|
||||
"css":"clickable",
|
||||
"cwidth":14
|
||||
"cwidth":12
|
||||
},
|
||||
"binds":[
|
||||
{
|
||||
@ -31,8 +31,7 @@
|
||||
{
|
||||
"widgettype":"Text",
|
||||
"options":{
|
||||
"wrap":false,
|
||||
"text":"{{get_username()}}({{str(get_user_roles(get_user()))}})"
|
||||
"text":"{{get_username()}}"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
@ -1,7 +1,12 @@
|
||||
{
|
||||
"widgettype":"Menu",
|
||||
"options":{
|
||||
"cwidth":10,
|
||||
"target":"PopupWindow",
|
||||
"popup_options":{
|
||||
"height":"70%",
|
||||
"width":"70%"
|
||||
},
|
||||
"items":[
|
||||
{% if 'customer' in get_user_roles(get_user()) %}
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user