| | |
| | | import Vue from 'vue' |
| | | import { ACCESS_TOKEN, TENANT_ID } from "@/store/mutation-types" |
| | | import store from '@/store' |
| | | import { buttonShowAuthFilter } from '@/utils/authFilter' |
| | | |
| | | export const JeecgListMixin = { |
| | | data(){ |
| | |
| | | } |
| | | }, |
| | | methods:{ |
| | | isShowAuth(code){ |
| | | return buttonShowAuthFilter(code); |
| | | }, |
| | | loadData(arg) { |
| | | if(!this.url.list){ |
| | | this.$message.error("请设置url.list属性!") |
| | |
| | | function substrPre(str,pre) { |
| | | return str.substr(pre.length); |
| | | } |
| | | /** |
| | | * 显示权限 |
| | | * @param {*} code |
| | | * @returns |
| | | */ |
| | | export function buttonShowAuthFilter(code) { |
| | | if(code){ |
| | | if(nodeShowAuth(code)){ |
| | | return true; |
| | | }else{ |
| | | return false; |
| | | } |
| | | }else{ |
| | | return false; |
| | | } |
| | | } |
| | | function nodeShowAuth(code){ |
| | | let authList = JSON.parse(sessionStorage.getItem(USER_AUTH) || "[]"); |
| | | for (let auth of authList) { |
| | | if(auth.action == code) { |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | | } |