import { useI18n } from '@/hooks/web/useI18n'
import { useUserStore } from '@/store/modules/user'
export const hasPermi = (value: string) => {
  const { t } = useI18n()
  const permission = (useUserStore().getRoleName || []) as string[]
  if (!value) {
    throw new Error(t('permission.hasPermission'))
  }
  if (permission.includes(value)) {
    return true
  }
  return false
}
