From 70cb8913d78ac696e6e1543be49092076cd94335 Mon Sep 17 00:00:00 2001 From: xuyiming Date: Thu, 18 Jun 2020 18:18:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9D=83=E9=99=90=E7=AE=A1=E7=90=86fixed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/menu.vue | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/src/components/menu.vue b/src/components/menu.vue index 3e59e11..85ef93f 100644 --- a/src/components/menu.vue +++ b/src/components/menu.vue @@ -183,15 +183,25 @@ export default { }; }, mounted() { - if (this.$store.level == 2) { - this.user_arr = [ - { name: "个人档案", path: "/user/user_info" }, - { name: "消息通知", path: "/user/message" }, - { name: "收银中心", path: "/authority" }, - { name: "关于BD-aPaaS", path: "/data_analysis" }, - { name: "退出登录", path: "logout" }, - ]; - } + this.$api.user.getNowUser().then(({ data }) => { + if (data.success == 1) { + this.$store.commit("userInfofun", data.data); + + const userLevel = this.$store.getters.level; + + if (userLevel === 2) { + this.user_arr = [ + { name: "个人档案", path: "/user/user_info" }, + { name: "消息通知", path: "/user/message" }, + { name: "收银中心", path: "/authority" }, + { name: "关于BD-aPaaS", path: "/data_analysis" }, + { name: "退出登录", path: "logout" }, + ]; + } + } else { + console.log(data.errMsg); + } + }); this.getMenuIndex(); this.getList(); -- 2.26.0