{"remainingRequest":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/node_modules/thread-loader/dist/cjs.js!/data/jenkins/workspace/mer.ws.baibaodun.com.cn/node_modules/babel-loader/lib/index.js!/data/jenkins/workspace/mer.ws.baibaodun.com.cn/src/plugins/auth.js","dependencies":[{"path":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/src/plugins/auth.js","mtime":1701742078550},{"path":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/babel.config.js","mtime":1701742078504},{"path":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/node_modules/thread-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/node_modules/babel-loader/lib/index.js","mtime":456789000000}],"contextDependencies":[],"result":["// +----------------------------------------------------------------------\n// | CRMEB [ CRMEB赋能开发者，助力企业发展 ]\n// +----------------------------------------------------------------------\n// | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.\n// +----------------------------------------------------------------------\n// | Licensed CRMEB并不是自由软件，未经许可不能去掉CRMEB相关版权\n// +----------------------------------------------------------------------\n// | Author: CRMEB Team <admin@crmeb.com>\n// +----------------------------------------------------------------------\n\nimport store from '@/store';\nfunction authPermission(permission) {\n  var all_permission = '*:*:*';\n  var permissions = store.getters && store.getters.permissions;\n  if (permission && permission.length > 0) {\n    return permissions.some(function (v) {\n      return all_permission === v || v === permission;\n    });\n  } else {\n    return false;\n  }\n}\nfunction authRole(role) {\n  var super_admin = 'admin';\n  var roles = store.getters && store.getters.roles;\n  if (role && role.length > 0) {\n    return roles.some(function (v) {\n      return super_admin === v || v === role;\n    });\n  } else {\n    return false;\n  }\n}\nexport default {\n  // 验证用户是否具备某权限\n  hasPermi: function hasPermi(permission) {\n    return authPermission(permission);\n  },\n  // 验证用户是否含有指定权限，只需包含其中一个\n  hasPermiOr: function hasPermiOr(permissions) {\n    return permissions.some(function (item) {\n      return authPermission(item);\n    });\n  },\n  // 验证用户是否含有指定权限，必须全部拥有\n  hasPermiAnd: function hasPermiAnd(permissions) {\n    return permissions.every(function (item) {\n      return authPermission(item);\n    });\n  }\n};",null]}