  import {
    getButtonList
  } from "@/api/user"
  const getDefaultState = () => {
    return {
      showButtons: {
        tiftojpg: false,
        bbsjq: false,
        zdcxsz:false,
        xtcspz:false,
      },
  
    }
  }
  const state = getDefaultState()
  const mutations = {
    GET_BUTTON_LIST(state, data) {
      data.forEach(item => {
        state.showButtons[item.key] = true
      })
    }
  }
  const actions = {
    async getButtonList({
      commit
    }, params) {
      await getButtonList(params).then(res => {
        commit('GET_BUTTON_LIST', res.body.list)
      })
    }
  }
  export default {
    namespaced: true,
    state,
    mutations,
    actions
  }
  