This commit is contained in:
2026-07-14 14:34:34 +08:00
parent 37a17972af
commit 93ef06cfe6
119 changed files with 1805 additions and 638 deletions
@@ -419,6 +419,25 @@ layout("/layouts/v4/baseLayout.html"){
},
defaultSelect() {
// 应用中心点击根菜单时会缓存完整应用信息,根菜单配置了href则应优先进入根菜单页面。
try {
const rootApp = JSON.parse(window.sessionStorage.getItem("zhgh_sub_app"))
const currentAppId = GetQueryString("appId")
const hasRootHref = rootApp && typeof rootApp.href === "string" && rootApp.href.trim() !== ""
// 校验缓存应用与当前URL一致,避免复用旧标签页缓存时跳转到其他应用。
if (hasRootHref && String(rootApp.id) === currentAppId) {
this.activeMenuIndex = rootApp.id
this.openedMenus = []
this.$nextTick(() => {
this.menuSelect(this.activeMenuIndex, this.openedMenus)
commonUtil.pjaxPush(getBaseSubAppPath(rootApp.href))
})
return
}
} catch (e) {
// 根菜单缓存缺失或格式异常时,继续使用子菜单href作为默认入口。
}
// 查找第一个有href的子菜单
function findFirstChildWithHref(menus) {
for (const menu of menus) {