import Vue from 'vue'; import Vuex from 'vuex'; import _ from 'lodash'; Vue.use(Vuex); const api = { list: `/api/jobs/talks`, fetch: id => `/api/jobs/talks/${id}`, }; export const state = () => ({}); export const mutations = {}; export const actions = { async getTalk({ state }, { type, data }) { let { skip = 0, limit } = data; let result; if (type !== 'fetch') { let { schid, date, ...searchInfo } = data; result = await this.$axios.$get(_.get(api, type), { schid: schid, skip: skip, limit: limit, date: date, status: '1', ...searchInfo, }); } if (type === 'fetch') { let { id } = data; result = await this.$axios.$get(api.fetch(id)); } return result; }, };