auth.js 1.1 KB

1234567891011121314151617181920212223242526272829
  1. // +---------------------------------------------------------------------
  2. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  3. // +---------------------------------------------------------------------
  4. // | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
  5. // +---------------------------------------------------------------------
  6. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  7. // +---------------------------------------------------------------------
  8. // | Author: CRMEB Team <admin@crmeb.com>
  9. // +---------------------------------------------------------------------
  10. /**
  11. * @description 判断列表1中是否包含了列表2中的某一项
  12. * 因为用户权限 access 为数组,includes 方法无法直接得出结论
  13. * */
  14. function includeArray(list1, list2) {
  15. let status = false;
  16. if (list1 === true) {
  17. return true;
  18. } else {
  19. if (typeof list2 !== 'object') {
  20. return false;
  21. }
  22. list2.forEach((item) => {
  23. if (list1.includes(item)) status = true;
  24. });
  25. return status;
  26. }
  27. }
  28. export { includeArray };