feat: 租户品牌设置页面(tenant_brand.ui) + 保存端点

This commit is contained in:
yumoqing 2026-07-09 12:03:31 +08:00
parent 09bf64378f
commit ec51ff30da
2 changed files with 39 additions and 0 deletions

26
wwwroot/tenant_brand.ui Normal file
View File

@ -0,0 +1,26 @@
# 租户品牌设置 - 设置左上角图标和系统名称
userorgid = await get_userorgid()
env = request._run_ns
async with get_sor_context(env, 'sage') as sor:
org = (await sor.sqlExe('SELECT orgname, iconid FROM organization WHERE id = ${orgid}$', {'orgid': userorgid}))[0]
result = {
"widgettype": "VBox",
"options": {"width": "100%", "padding": "20px", "spacing": 16},
"subwidgets": [
{"widgettype": "Title3", "options": {"text": "租户品牌设置"}},
{"widgettype": "Text", "options": {"text": "设置左上角显示的图标和系统名称"}},
{
"widgettype": "Form",
"options": {
"url": entire_url('./tenant_brand_save.dspy'),
"cols": 1,
"submit_label": "保存",
"fields": [
{"name": "orgname", "type": "text", "label": "系统名称", "default": org.orgname or ''},
{"name": "iconid", "type": "file", "label": "图标(SVG/PNG)", "uitype": "file", "accept": ".svg,.png,.jpg"}
]
}
}
]
}

View File

@ -0,0 +1,13 @@
# 保存租户品牌设置
userorgid = await get_userorgid()
orgname = params_kw.get('orgname', '')
iconid = params_kw.get('iconid', '')
env = request._run_ns
async with get_sor_context(env, 'sage') as sor:
await sor.U('organization', {'id': userorgid, 'orgname': orgname, 'iconid': iconid})
result = {
"widgettype": "Message",
"options": {"title": "成功", "message": "品牌设置已保存,刷新页面生效", "type": "success"}
}