From 965bdc9986ba66b10c2783b514b1cbdd19b29077 Mon Sep 17 00:00:00 2001 From: 若依 <yzz_ivy@163.com> Date: 星期六, 19 二月 2022 17:08:50 +0800 Subject: [PATCH] !431 修改登录超时刷新页面跳转登录页面还提示重新登录问题 Merge pull request !431 from 也曾为你、像超人/master --- ruoyi-ui/src/layout/components/Sidebar/SidebarItem.vue | 13 ++++++++++--- 1 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ruoyi-ui/src/layout/components/Sidebar/SidebarItem.vue b/ruoyi-ui/src/layout/components/Sidebar/SidebarItem.vue index 1ca89d2..1baf540 100644 --- a/ruoyi-ui/src/layout/components/Sidebar/SidebarItem.vue +++ b/ruoyi-ui/src/layout/components/Sidebar/SidebarItem.vue @@ -1,7 +1,7 @@ <template> - <div v-if="!item.hidden" class="menu-wrapper"> + <div v-if="!item.hidden"> <template v-if="hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren)&&!item.alwaysShow"> - <app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path)"> + <app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path, onlyOneChild.query)"> <el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}"> <item :icon="onlyOneChild.meta.icon||(item.meta&&item.meta.icon)" :title="onlyOneChild.meta.title" /> </el-menu-item> @@ -56,6 +56,9 @@ }, methods: { hasOneShowingChild(children = [], parent) { + if (!children) { + children = []; + } const showingChildren = children.filter(item => { if (item.hidden) { return false @@ -79,13 +82,17 @@ return false }, - resolvePath(routePath) { + resolvePath(routePath, routeQuery) { if (isExternal(routePath)) { return routePath } if (isExternal(this.basePath)) { return this.basePath } + if (routeQuery) { + let query = JSON.parse(routeQuery); + return { path: path.resolve(this.basePath, routePath), query: query } + } return path.resolve(this.basePath, routePath) } } -- Gitblit v1.9.2