From ed3ee7f9dc9ccef54477248a26de25d8186f0693 Mon Sep 17 00:00:00 2001 From: wyj2080 <1603068044@qq.com> Date: Thu, 23 Apr 2020 18:43:13 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E5=8F=AA=E7=BB=99admin?= =?UTF-8?q?=E5=92=8C=E8=BF=90=E8=90=A5=E4=BA=BA=E5=91=98=E7=9C=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Home.vue | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/src/pages/Home.vue b/src/pages/Home.vue index 2d5df56..42023d9 100644 --- a/src/pages/Home.vue +++ b/src/pages/Home.vue @@ -11,7 +11,7 @@ - + 首页 @@ -56,6 +56,7 @@ }, data() { return { + roleCode: JSON.parse(sessionStorage.getItem("loginInfo")).roleCode, mainUrl: "/customer/view", isCollapsed: false, mHeight: 600, @@ -247,21 +248,24 @@ //导航栏初始化 menuInit: function () { let that = this; - //默认首页 - that.selectedItemName = 0; - this.$router.push({path: that.mainUrl}); - this.selectedMenu = "首页"; - this.breadcrumbUrl = this.mainUrl; - // that.selectedItemName = that.onePermissionList[0].subMenuList[0].id; - // that.openName = [that.onePermissionList[0].id]; - // this.$nextTick(() => { - // this.$refs.menu.updateOpened(); - // this.$refs.menu.updateActiveName(); - // }); - // this.selectedMenu = this.onePermissionList[0].name; - // this.selectedSubMenu = this.onePermissionList[0].subMenuList[0].name; - // sessionStorage.setItem("threeLevel",JSON.stringify(this.onePermissionList[0].subMenuList[0].subMenuList)); - // this.$router.push({path: that.onePermissionList[0].subMenuList[0].resource}); + if(this.roleCode === 'GLY-ADMIN' || this.roleCode === 'DG-YUNYING'){ + //默认首页 + that.selectedItemName = 0; + this.$router.push({path: that.mainUrl}); + this.selectedMenu = "首页"; + this.breadcrumbUrl = this.mainUrl; + }else{ + that.selectedItemName = that.onePermissionList[0].subMenuList[0].id; + that.openName = [that.onePermissionList[0].id]; + this.$nextTick(() => { + this.$refs.menu.updateOpened(); + this.$refs.menu.updateActiveName(); + }); + this.selectedMenu = this.onePermissionList[0].name; + this.selectedSubMenu = this.onePermissionList[0].subMenuList[0].name; + sessionStorage.setItem("threeLevel",JSON.stringify(this.onePermissionList[0].subMenuList[0].subMenuList)); + this.$router.push({path: that.onePermissionList[0].subMenuList[0].resource}); + } }, //账户管理页面回调方法