import useRouteStore from '@/store/modules/route'
/**
 * 判断是否有某项权限
  */
export function hasPermission(permission: string) {
  const routeStore = useRouteStore()
  const btns = routeStore.btns
  return btns.some((btn) => { // 遍历btns，查找btn.url是否有匹配的permission，有则返回true，否则返回false
    return btn.url === permission
  })
}
