import store from '@/store'
export default {
  domCheckPermi(value) {
    console.log(12312312312312312312123312312321);
    if (value && value instanceof Array && value.length > 0) {
      const permissions = store.getters && store.getters.permissions
      const permissionDatas = value
      const all_permission = "*:*:*";

      const hasPermission = permissions.some(permission => {
        return all_permission === permission || permissionDatas.includes(permission)
      })

      if (!hasPermission) {
        return false
      }
      return true
    } else {
      console.error(`need roles! Like checkPermi="['system:user:add','system:user:edit']"`)
      return false
    }
  }
}
