diff --git a/src/App.vue b/src/App.vue index 3246e33a242b764903977bc599fe145ffbe254a1..e1674d35bbdb08a9af56dafc8a6b1e8b980086db 100644 --- a/src/App.vue +++ b/src/App.vue @@ -66,9 +66,7 @@ export default { }, setHtmlTitle() { const route = this.$route; - const key = - route.path === '/' ? 'home.name' : getI18nKey(route.matched[route.matched.length - 1].path); - document.title = process.env.VUE_APP_NAME + ' | ' + this.$t(key); + if (route.name) window.title = route.name; }, popContainer() { return document.getElementById('popContainer'); diff --git a/src/components/menu/menu.js b/src/components/menu/menu.js index 884999f4ff7e2d76ce15cce5760d142e3e47abbd..e24b0c23bc88aa6ee83e57a163346f23a0cdf6b5 100644 --- a/src/components/menu/menu.js +++ b/src/components/menu/menu.js @@ -186,6 +186,7 @@ export default { getOpenKeysByPath(path) { const { menuList } = getUserInfo(); const { parentMenuId } = this.menuData.find(m => m.menuUrl === path); + if (parentMenuId === 0) return []; const parentMenus = [parentMenuId]; const res = [parentMenuId]; while (parentMenus.length) {