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