commit
This commit is contained in:
@@ -419,25 +419,6 @@ 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) {
|
||||
@@ -479,6 +460,25 @@ layout("/layouts/v4/baseLayout.html"){
|
||||
tempLink.click()
|
||||
document.body.removeChild(tempLink)*/
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
// 没有已授权的可用子菜单时,才使用当前应用自身配置的地址作为兜底入口。
|
||||
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))
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
// 根菜单缓存缺失或格式异常时保持当前页面,不执行无权限地址跳转。
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user