【update】-按钮权限做内外系统的判定
This commit is contained in:
@@ -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,16 +78,34 @@ 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) || '[]')
|
||||||
for (let auth of authList) {
|
// 内外部系统做不同的判定
|
||||||
if(auth.type != '2') {
|
if (isExternalTerminal) {
|
||||||
permissionList.push(auth)
|
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));
|
//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) || '[]')
|
||||||
for (let gauth of allAuthList) {
|
// 内外部系统做不同的判定
|
||||||
if(gauth.type != '2') {
|
if (isExternalTerminal) {
|
||||||
allPermissionList.push(gauth)
|
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)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//设置全局配置是否有命中
|
//设置全局配置是否有命中
|
||||||
|
|||||||
Reference in New Issue
Block a user