diff --git a/wwwroot/user/up_login.dspy b/wwwroot/user/up_login.dspy index 6436cd0..ef2af48 100644 --- a/wwwroot/user/up_login.dspy +++ b/wwwroot/user/up_login.dspy @@ -26,16 +26,16 @@ async with db.sqlorContext(dbname) as sor: "timeout":3, "auto_open":True, "title":"Login", - "message":"Welcome back" + "message":f"{r[0].username} Welcome back" }, "binds":[ { "wid":"self", - "event":"dismissed", + "event":"opened", "actiontype":"urlwidget", - "target":"window", + "target":"window.user_container", "options":{ - "url":entire_url('/index.ui') + "url":entire_url('/rbac/user/userinfo.ui') } }, { diff --git a/wwwroot/user/user.ui b/wwwroot/user/user.ui index 85f6fbf..62cf68c 100644 --- a/wwwroot/user/user.ui +++ b/wwwroot/user/user.ui @@ -1,81 +1,15 @@ -{% if get_user() %} { - "widgettype":"HBox", + "id":"user_container", + "widgettype":"VBox", "options":{ - "css":"clickable", - "tip":"用户功能", "cwidth":6 }, - "binds":[ - { - "wid":"self", - "event":"click", - "actiontype":"urlwidget", - "popup_options":{ - "eventpos":true, - "cwidth":12, - "dismiss_events":["command"] - }, - "target":"Popup", - "options":{ - "url":"{{entire_url('/user_menu.ui')}}" - } - } - ], "subwidgets":[ { - "widgettype":"Svg", + "widgettype":"urlwidget", "options":{ - "url":"{{entire_url('/bricks/imgs/user.svg')}}", - "rate":1.5 - } - }, - { - "widgettype":"Text", - "options":{ - "cwidth": 4, - "text":"{{get_username()}}" + "url":"{{entire_url('userinfo.ui')}}", } } ] } -{% else %} -{ - "widgettype":"IconBar", - "options":{ - "css":"filler", - "tools":[ - { - "name":"login", - "tip":"点击登录", - "icon":"{{entire_url('/bricks/imgs/login.svg')}}" - }, - { - "name":"register", - "tip":"点击注册", - "icon":"{{entire_url('/bricks/imgs/register.svg')}}" - } - ] - }, - "binds":[ - { - "wid":"self", - "event":"login", - "actiontype":"urlwidget", - "target":"self", - "options":{ - "url":"{{entire_url('login.ui')}}" - } - }, - { - "wid":"self", - "event":"register", - "actiontype":"urlwidget", - "target":"self", - "options":{ - "url":"{{entire_url('register.ui')}}" - } - } - ] -} -{% endif %} diff --git a/wwwroot/user/userinfo.ui b/wwwroot/user/userinfo.ui new file mode 100644 index 0000000..85f6fbf --- /dev/null +++ b/wwwroot/user/userinfo.ui @@ -0,0 +1,81 @@ +{% if get_user() %} +{ + "widgettype":"HBox", + "options":{ + "css":"clickable", + "tip":"用户功能", + "cwidth":6 + }, + "binds":[ + { + "wid":"self", + "event":"click", + "actiontype":"urlwidget", + "popup_options":{ + "eventpos":true, + "cwidth":12, + "dismiss_events":["command"] + }, + "target":"Popup", + "options":{ + "url":"{{entire_url('/user_menu.ui')}}" + } + } + ], + "subwidgets":[ + { + "widgettype":"Svg", + "options":{ + "url":"{{entire_url('/bricks/imgs/user.svg')}}", + "rate":1.5 + } + }, + { + "widgettype":"Text", + "options":{ + "cwidth": 4, + "text":"{{get_username()}}" + } + } + ] +} +{% else %} +{ + "widgettype":"IconBar", + "options":{ + "css":"filler", + "tools":[ + { + "name":"login", + "tip":"点击登录", + "icon":"{{entire_url('/bricks/imgs/login.svg')}}" + }, + { + "name":"register", + "tip":"点击注册", + "icon":"{{entire_url('/bricks/imgs/register.svg')}}" + } + ] + }, + "binds":[ + { + "wid":"self", + "event":"login", + "actiontype":"urlwidget", + "target":"self", + "options":{ + "url":"{{entire_url('login.ui')}}" + } + }, + { + "wid":"self", + "event":"register", + "actiontype":"urlwidget", + "target":"self", + "options":{ + "url":"{{entire_url('register.ui')}}" + } + } + ] +} +{% endif %}