/*
 * @Author: zhanyoulin<zhanyoulin456@163.com>
 * @Date: 2023-06-25 09:01:18
 * @LastEditors: zhanyoulin
 * @LastEditTime: 2023-06-29 18:15:22
 * @Description:
 */
import { computed } from 'vue'
import { useAuthStore } from '@/stores/modules/auth'

/**
 * @description 页面按钮权限
 * */
export const useAuthButtons = () => {
  const authStore = useAuthStore()
  const authButtons = authStore.authButtonListGet || []

  const BUTTONS = computed(() => {
    let currentPageAuthButton: { [key: string]: boolean } = {}
    authButtons.forEach(item => (currentPageAuthButton[item] = true))
    return currentPageAuthButton
  })

  return {
    BUTTONS
  }
}
