feat: 移除门户页,登录后默认直达驾驶舱(issue #131)

- web/index.html 改为纯重定向页(/ → cockpit/,驾驶舱自带登录守卫)
- 登录页默认 next 改为 ../cockpit/,页脚入口链接同步调整
- Sider 菜单移除「门户」项,logo/默认首页指向驾驶舱
This commit is contained in:
2026-08-05 15:54:14 +08:00
parent 2f6b329745
commit 0b3dc0b9ae
4 changed files with 21 additions and 181 deletions
+4 -3
View File
@@ -52,7 +52,7 @@
return mods[i].key;
}
}
return path === "/" || /\/index\.html$/.test(path) ? "portal" : "";
return ""; // 根路径已重定向驾驶舱,无独立「门户」页
}
/* 当前 hash 命中的子菜单 key(# 前缀归一化) */
@@ -96,7 +96,8 @@
if (!body || document.querySelector(".pro-sider")) return;
var title = body.getAttribute("data-pro-title") || document.title || "";
var home = body.getAttribute("data-pro-home") || "../index.html";
// 无门户页(2026-08):logo 与默认首页均指向驾驶舱
var home = body.getAttribute("data-pro-home") || "../cockpit/";
var loginUrl = body.getAttribute("data-pro-login") || "../auth/login.html";
var prefix = rootPrefix();
var active = activeModuleKey();
@@ -202,7 +203,7 @@
function renderMenu(user) {
menu.innerHTML = "";
addLeafItem("portal", "🏠", "门户", prefix + "index.html");
// 无门户页(2026-08):菜单即模块清单,按角色过滤
var mods = user ? IAOP_SESSION.modulesFor(user.role) : [];
mods.forEach(function (m) {
if (m.children && m.children.length) addSubMenu(m);