From 8c46c6e2547717b9e21cbac267e4c0ec668550ec Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Sat, 21 Aug 2021 20:20:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layouts/header/index.vue | 6 +++ src/layouts/home/index.vue | 8 +--- src/layouts/navbar/index.vue | 1 + src/libs/auth/generateBtnPermission.js | 2 +- src/libs/route/addRoutes.js | 4 +- src/pages/data/list/index.vue | 64 ++++++++++++++++---------- src/pages/index/list/index.vue | 11 +++-- src/pages/role/list/index.vue | 6 +++ src/pages/setting/person/download.vue | 3 ++ src/pages/setting/person/index.vue | 2 + src/pages/setting/person/info.vue | 1 + src/pages/stat/list/index.vue | 4 ++ src/pages/user/list/index.vue | 8 +++- src/plugins/auth/index.js | 2 + src/plugins/requests/index.js | 1 + src/setting.js | 8 +--- src/store/modules/user.js | 1 + 17 files changed, 87 insertions(+), 45 deletions(-) diff --git a/src/layouts/header/index.vue b/src/layouts/header/index.vue index 4ab9232..7667a81 100644 --- a/src/layouts/header/index.vue +++ b/src/layouts/header/index.vue @@ -113,10 +113,13 @@ export default { } }, mounted(){ + // 如果是客户,则存到store里去,因为客户是没有用户信息的,上面要根据这个值来判断显示与否 if(this.customer){ let customer = atob(decodeURI(this.customer)) == 'false' ? false : true this.setCustomer(customer) } + + // 如果登录了,才调用用户信息的接口 this.token && this.getUserInfo() }, methods: { @@ -130,6 +133,7 @@ export default { let isManager = userAccount.roleId != '0' this.isUser = isManager let mg = this.$route.query.mg + // 如果是管理员 if(mg && atob(decodeURI(mg)) === 'true'){ this.showSetting = false } @@ -161,6 +165,7 @@ export default { title: '登录' }) }, + // 跳转到管理员后台 toManager(){ let routes = this.routes if(routes.length){ @@ -174,6 +179,7 @@ export default { }) window.open(route.href) }else{ + // 如果接口返回的角色权限为空,则表示没有给该角色开放任何模块权限,直接提示用户未开放 util.warningMsg('该角色未开放模块,请联系管理员') } }, diff --git a/src/layouts/home/index.vue b/src/layouts/home/index.vue index 1917ab1..ddb8fc1 100644 --- a/src/layouts/home/index.vue +++ b/src/layouts/home/index.vue @@ -18,13 +18,11 @@