import axios from 'axios'
const api = {
  query: '/api/menu/query'
}
const state = {
  items: []
}
const mutations = {
  menus (state, payload) {
    state.items = payload
  }
}
const actions = {
  async getmenu ({ commit }, payload) {
    const res = await axios.get(api.query)
    if (res.data.errcode === 0) commit('menus', res.data.data)
    return res
  }
}
export default { state, mutations, actions, namespaced: true }
