From 40ea3f89ee1e1b584132e49d67a5ed8ec2f2d75a Mon Sep 17 00:00:00 2001 From: yumoqing Date: Sun, 31 May 2026 08:57:48 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20customer=E8=A7=92=E8=89=B2=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=20-=20=E6=8C=89customer.admin/customer.customer?= =?UTF-8?q?=E5=88=86=E9=85=8D=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit customer用户菜单: - 仪表盘 (所有用户) - 真人素材 (所有customer) - 大模型API (所有customer) - 我的帐务 (admin - 含充值/余额/明细) - 信用额度 (admin - 含使用状态) - API Key管理 (admin) - 用户与权限 (admin - 添加用户/设置角色) 非customer用户保留原有平台管理菜单 --- wwwroot/global_menu.ui | 53 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/wwwroot/global_menu.ui b/wwwroot/global_menu.ui index 7c0081a..cba8313 100644 --- a/wwwroot/global_menu.ui +++ b/wwwroot/global_menu.ui @@ -1,4 +1,8 @@ {% set roles = get_user_roles(get_user()) %} +{% set role_str = roles|join(',') %} +{% set is_customer = 'customer.' in role_str %} +{% set is_customer_admin = 'customer.admin' in roles %} +{% set is_platform_op = 'owner.superuser' in roles or 'reseller.operator' in roles %} { "widgettype": "Menu", "id": "global_nav_menu", @@ -13,6 +17,52 @@ "url": "{{entire_url('/dashboard_for_sage/index.ui')}}", "target": "app.sage_main_content" } +{% if is_customer %} + ,{ + "name": "reallife_asset", + "label": "真人素材", + "icon": "fa fa-user-circle", + "url": "{{entire_url('/reallife_asset/index.ui')}}", + "target": "app.sage_main_content" + } + ,{ + "name": "llm_api", + "label": "大模型API", + "icon": "fa fa-rocket", + "url": "{{entire_url('/uapi/upapp/index.ui')}}", + "target": "app.sage_main_content" + } +{% if is_customer_admin %} + ,{ + "name": "myaccount", + "label": "我的帐务", + "icon": "fa fa-wallet", + "url": "{{entire_url('/accounting/myaccounts.ui')}}", + "target": "app.sage_main_content" + } + ,{ + "name": "credit_limit", + "label": "信用额度", + "icon": "fa fa-credit-card", + "url": "{{entire_url('/accounting/credit_limit/hub.ui')}}", + "target": "app.sage_main_content" + } + ,{ + "name": "apikey_manage", + "label": "API Key管理", + "icon": "fa fa-key", + "url": "{{entire_url('/uapi/upappkey/index.ui')}}", + "target": "app.sage_main_content" + } + ,{ + "name": "rbac", + "label": "用户与权限", + "icon": "fa fa-user-shield", + "url": "{{entire_url('/rbac')}}", + "target": "app.sage_main_content" + } +{% endif %} +{% else %} ,{ "name": "reallife_asset", "label": "真人素材", @@ -92,7 +142,7 @@ "target": "app.sage_main_content" } {% endif %} -{% if 'reseller.operator' in roles or 'owner.superuser' in roles %} +{% if is_platform_op %} ,{ "name": "platformbiz", "label": "平台业务", @@ -123,6 +173,7 @@ "url": "{{entire_url('/rbac')}}", "target": "app.sage_main_content" } +{% endif %} {% endif %} ], "menuitem_css": "menuitem"