fix: 「用户与角色」模块切换到 FBA UI 承载(Epic #159 遗漏收尾)

This commit is contained in:
2026-08-06 11:37:40 +08:00
parent 4a7b5e4f21
commit 9728fa40fe
3 changed files with 35 additions and 6 deletions
+8 -3
View File
@@ -182,14 +182,18 @@
}
/* ---- 菜单渲染(需要登录角色,异步) ----------------------------------- */
function addLeafItem(key, icon, text, href) {
function addLeafItem(key, icon, text, href, external) {
var a = el("a", "pro-menu-item" + (key === active ? " active" : ""));
a.href = href;
a.title = text;
a.setAttribute("data-module", key);
a.appendChild(el("span", "pro-menu-icon", icon));
a.appendChild(el("span", "pro-menu-text", text));
if (SHELL) {
if (external) {
// 外部承载模块(FBA UI 等):新标签打开,不进 iframe 外壳
a.target = "_blank";
a.rel = "noopener";
} else if (SHELL) {
a.addEventListener("click", function (e) {
e.preventDefault();
go(href);
@@ -250,7 +254,8 @@
// 输出(FBA 服务端按角色授权过滤,本地角色过滤兜底)
(mods || []).forEach(function (m) {
if (m.children && m.children.length) addSubMenu(m);
else addLeafItem(m.key, m.icon, m.title, prefix + m.url);
else addLeafItem(m.key, m.icon, m.title,
m.external ? m.url : prefix + m.url, !!m.external);
});
if (!SHELL) syncSubHighlight();
// 菜单(重)渲染完成事件:shell.js 据此重放当前高亮,