From 2ebb7bd20a251ee8879bd25a1fda925a0703a7a9 Mon Sep 17 00:00:00 2001 From: zer0Black <694429613@qq.com> Date: Sun, 17 Apr 2022 19:18:19 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91=E9=A6=96?= =?UTF-8?q?=E9=A1=B5=E6=9D=83=E9=99=90=E4=B8=8D=E5=AD=98=E5=9C=A8=EF=BC=8C?= =?UTF-8?q?=E5=88=99tab=E4=B8=8D=E6=98=BE=E7=A4=BA=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=20=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91?= =?UTF-8?q?=E9=80=80=E5=87=BA=E7=99=BB=E5=BD=95=E4=B8=8D=E9=80=9A=E8=BF=87?= =?UTF-8?q?=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jero-web/src/components/layouts/TabLayout.vue | 42 ++----------------- jero-web/src/components/tools/UserMenu.vue | 5 +-- jero-web/src/views/user/Login.vue | 2 +- 3 files changed, 5 insertions(+), 44 deletions(-) diff --git a/jero-web/src/components/layouts/TabLayout.vue b/jero-web/src/components/layouts/TabLayout.vue index f1dca771..f9907aa0 100644 --- a/jero-web/src/components/layouts/TabLayout.vue +++ b/jero-web/src/components/layouts/TabLayout.vue @@ -14,7 +14,7 @@ @change="changePage" @tabClick="tabCallBack" @edit="editPage"> - + {{ page.meta.title }} @@ -39,7 +39,7 @@ import { triggerWindowResizeEvent } from '@/utils/util' import Vue from 'vue' import { CACHE_INCLUDED_ROUTES } from '@/store/mutation-types' -const indexKey = '/dashboard/analysis' +const indexKey = '/' export default { name: 'TabLayout', @@ -81,9 +81,6 @@ const indexKey = '/dashboard/analysis' } }, created() { - if (this.$route.path != indexKey) { - this.addIndexToFirst() - } // 复制一个route对象出来,不能影响原route let currentRoute = Object.assign({}, this.$route) currentRoute.meta = Object.assign({}, currentRoute.meta) @@ -138,31 +135,8 @@ const indexKey = '/dashboard/analysis' } } }, - // update-begin-author:sunjianlei date:20191223 for: 修复从单页模式切换回多页模式后首页不居第一位的 BUG - device() { - if (this.multipage && this.linkList.indexOf(indexKey) === -1) { - this.addIndexToFirst() - } - }, - // update-end-author:sunjianlei date:20191223 for: 修复从单页模式切换回多页模式后首页不居第一位的 BUG }, methods: { - // update-begin-author:sunjianlei date:20191223 for: 修复从单页模式切换回多页模式后首页不居第一位的 BUG - // 将首页添加到第一位 - addIndexToFirst() { - this.pageList.splice(0, 0, { - name: 'dashboard-analysis', - path: indexKey, - fullPath: indexKey, - meta: { - icon: 'dashboard', - title: '首页' - } - }) - this.linkList.splice(0, 0, indexKey) - }, - // update-end-author:sunjianlei date:20191223 for: 修复从单页模式切换回多页模式后首页不居第一位的 BUG - // update-begin-author:sunjianlei date:20200120 for: 动态更改页面标题 changeTitle(title) { let projectTitle = "Jero-Boot 企业级快速开发平台" @@ -192,10 +166,6 @@ const indexKey = '/dashboard/analysis' this[action](key) }, remove(key) { - if (key == indexKey) { - this.$message.warning('首页不能关闭!') - return - } if (this.pageList.length === 1) { this.$message.warning('这是最后一页,不能再关闭了啦') return @@ -264,17 +234,14 @@ const indexKey = '/dashboard/analysis' }, /* update_end author:wuxianquan date:20190828 for: 关闭当前tab页,供子页面调用->望菜单能配置外链,直接弹出新页面而不是嵌入iframe #428 */ closeOthers(pageKey) { - let index = this.linkList.indexOf(pageKey) + let index = this.linkList.indexOf(pageKey) if (pageKey == indexKey || pageKey.indexOf('?ticke=')>=0) { this.linkList = this.linkList.slice(index, index + 1) this.pageList = this.pageList.slice(index, index + 1) this.activePage = this.linkList[0] } else { - let indexContent = this.pageList.slice(0, 1)[0] this.linkList = this.linkList.slice(index, index + 1) this.pageList = this.pageList.slice(index, index + 1) - this.linkList.unshift(indexContent.fullPath) - this.pageList.unshift(indexContent) this.activePage = this.linkList[1] } }, @@ -283,12 +250,9 @@ const indexKey = '/dashboard/analysis' return } let tempList = [...this.pageList] - let indexContent = tempList.slice(0, 1)[0] let index = this.linkList.indexOf(pageKey) this.linkList = this.linkList.slice(index) this.pageList = this.pageList.slice(index) - this.linkList.unshift(indexContent.fullPath) - this.pageList.unshift(indexContent) if (this.linkList.indexOf(this.activePage) < 0) { this.activePage = this.linkList[0] } diff --git a/jero-web/src/components/tools/UserMenu.vue b/jero-web/src/components/tools/UserMenu.vue index c25a0b0a..d0f23974 100644 --- a/jero-web/src/components/tools/UserMenu.vue +++ b/jero-web/src/components/tools/UserMenu.vue @@ -183,10 +183,7 @@ content: '真的要注销登录吗 ?', onOk() { return that.Logout({}).then(() => { - // update-begin author:wangshuai date:20200601 for: 退出登录跳转登录页面 - that.$router.push({ path: '/user/login' }); - window.location.reload() - // update-end author:wangshuai date:20200601 for: 退出登录跳转登录页面 + window.location.replace("/user/login") }).catch(err => { that.$message.error({ title: '错误', diff --git a/jero-web/src/views/user/Login.vue b/jero-web/src/views/user/Login.vue index ea1fc996..d3476e3f 100644 --- a/jero-web/src/views/user/Login.vue +++ b/jero-web/src/views/user/Login.vue @@ -332,7 +332,7 @@ }) }, loginSuccess () { - this.$router.push({ path: "/dashboard/analysis" }).catch((res)=>{}) + this.$router.push({ path: "/" }).catch((res)=>{}) this.$notification.success({ message: '欢迎', description: `${timeFix()},欢迎回来`,