【update】-按钮权限做内外系统的判定

This commit is contained in:
fengchenchen
2023-08-22 16:51:02 +08:00
parent 9f170896a5
commit 308990ed96
+26 -6
View File
@@ -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)
}
}
}
//设置全局配置是否有命中