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

This commit is contained in:
fengchenchen
2023-08-22 16:50:38 +08:00
parent 73fd4b708a
commit 95985c17b5
+19
View File
@@ -1,4 +1,5 @@
import { USER_AUTH,SYS_BUTTON_AUTH } from '@/store/mutation-types' import { USER_AUTH,SYS_BUTTON_AUTH } from '@/store/mutation-types'
import { isExternalTerminal } from './util'
const hasPermission = { const hasPermission = {
install (Vue, options) { install (Vue, options) {
@@ -77,18 +78,36 @@ export function filterGlobalPermission(el, binding, vnode) {
//let authList = Vue.ls.get(USER_AUTH); //let authList = Vue.ls.get(USER_AUTH);
let authList = JSON.parse(sessionStorage.getItem(USER_AUTH) || '[]') let authList = JSON.parse(sessionStorage.getItem(USER_AUTH) || '[]')
// 内外部系统做不同的判定
if (isExternalTerminal) {
for (let auth of authList) {
if(auth.type != '2' && auth.externalTerminalShow) {
permissionList.push(auth)
}
}
} else {
for (let auth of authList) { for (let auth of authList) {
if(auth.type != '2') { if(auth.type != '2') {
permissionList.push(auth) permissionList.push(auth)
} }
} }
}
//console.log("页面权限--Global--",sessionStorage.getItem(SYS_BUTTON_AUTH)); //console.log("页面权限--Global--",sessionStorage.getItem(SYS_BUTTON_AUTH));
let allAuthList = JSON.parse(sessionStorage.getItem(SYS_BUTTON_AUTH) || '[]') let allAuthList = JSON.parse(sessionStorage.getItem(SYS_BUTTON_AUTH) || '[]')
// 内外部系统做不同的判定
if (isExternalTerminal) {
for (let gauth of allAuthList) {
if(gauth.type != '2' && gauth.externalTerminalShow) {
allPermissionList.push(gauth)
}
}
} else {
for (let gauth of allAuthList) { for (let gauth of allAuthList) {
if(gauth.type != '2') { if(gauth.type != '2') {
allPermissionList.push(gauth) allPermissionList.push(gauth)
} }
} }
}
//设置全局配置是否有命中 //设置全局配置是否有命中
let invalidFlag = false//无效命中 let invalidFlag = false//无效命中
if(allPermissionList != null && allPermissionList != '' && allPermissionList != undefined && allPermissionList.length > 0){ if(allPermissionList != null && allPermissionList != '' && allPermissionList != undefined && allPermissionList.length > 0){