diff --git a/src/utils/hasPermission.js b/src/utils/hasPermission.js index dbfa20f..9eac420 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,34 @@ 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) + } } } //设置全局配置是否有命中