From 308990ed96db22ba3b7b8b823c8750b2fb0c0f5f Mon Sep 17 00:00:00 2001 From: fengchenchen Date: Tue, 22 Aug 2023 16:51:02 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90update=E3=80=91-=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E6=9D=83=E9=99=90=E5=81=9A=E5=86=85=E5=A4=96=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E7=9A=84=E5=88=A4=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/hasPermission.js | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/src/utils/hasPermission.js b/src/utils/hasPermission.js index dbfa20f..527dd69 100644 --- a/src/utils/hasPermission.js +++ b/src/utils/hasPermission.js @@ -1,4 +1,5 @@ import { USER_AUTH,SYS_BUTTON_AUTH } from '@/store/mutation-types' +import {isExternalTerminal} from './util' const hasPermission = { install (Vue, options) { @@ -77,16 +78,35 @@ export function filterGlobalPermission(el, binding, vnode) { //let authList = Vue.ls.get(USER_AUTH); let authList = JSON.parse(sessionStorage.getItem(USER_AUTH) || '[]') - for (let auth of authList) { - if(auth.type != '2') { - permissionList.push(auth) + // 内外部系统做不同的判定 + if (isExternalTerminal) { + for (let auth of authList) { + if(auth.type != '2' && auth.externalTerminalShow) { + permissionList.push(auth) + } + } + } else { + for (let auth of authList) { + if(auth.type != '2') { + permissionList.push(auth) + } } } + //console.log("页面权限--Global--",sessionStorage.getItem(SYS_BUTTON_AUTH)); let allAuthList = JSON.parse(sessionStorage.getItem(SYS_BUTTON_AUTH) || '[]') - for (let gauth of allAuthList) { - if(gauth.type != '2') { - allPermissionList.push(gauth) + // 内外部系统做不同的判定 + if (isExternalTerminal) { + for (let gauth of allAuthList) { + if(gauth.type != '2' && gauth.externalTerminalShow) { + allPermissionList.push(gauth) + } + } + } else { + for (let gauth of allAuthList) { + if(gauth.type != '2') { + allPermissionList.push(gauth) + } } } //设置全局配置是否有命中