zhangzengfei
2021-09-07 bcd7ab8a441e4ad848d2c6d6a87374d33b433789
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import store from '@/store'
 
/**
 * @author chuzhixin 1204505056@qq.com (不想保留author可删除)
 * @description 检查权限
 * @param value
 * @returns {boolean}
 */
export default function checkPermission(value) {
  if (value && value instanceof Array && value.length > 0) {
    const permissions = store.getters['user/permissions']
    const permissionPermissions = value
 
    return permissions.some((role) => {
      return permissionPermissions.includes(role)
    })
  } else {
    return false
  }
}