Lius
2025-07-05 f9fc61cf75c418bd183a8dbe6116ea120d69dee2
update
已修改2个文件
29 ■■■■■ 文件已修改
src/mixins/JeecgListMixin.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/authFilter.js 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/mixins/JeecgListMixin.js
@@ -8,6 +8,7 @@
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(){
@@ -74,6 +75,9 @@
    }
  },
  methods:{
    isShowAuth(code){
      return buttonShowAuthFilter(code);
    },
    loadData(arg) {
      if(!this.url.list){
        this.$message.error("请设置url.list属性!")
src/utils/authFilter.js
@@ -274,4 +274,29 @@
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;
}