|
@@ -3,37 +3,16 @@ import Vuex from 'vuex';
|
|
import _ from 'lodash';
|
|
import _ from 'lodash';
|
|
Vue.use(Vuex);
|
|
Vue.use(Vuex);
|
|
const api = {
|
|
const api = {
|
|
- site: `/api/setting/set`,
|
|
|
|
shows: `/api/setting/set/show`,
|
|
shows: `/api/setting/set/show`,
|
|
};
|
|
};
|
|
const state = () => ({});
|
|
const state = () => ({});
|
|
const mutations = {};
|
|
const mutations = {};
|
|
|
|
|
|
const actions = {
|
|
const actions = {
|
|
- async query({ commit }, { skip = 0, limit, ...info } = {}) {
|
|
|
|
- const res = await this.$axios.$get(`${api.site}`, { skip, limit, ...info });
|
|
|
|
- return res;
|
|
|
|
- },
|
|
|
|
async showInfo({ commit }, { ...info } = {}) {
|
|
async showInfo({ commit }, { ...info } = {}) {
|
|
const res = await this.$axios.$get(`${api.shows}`, { ...info });
|
|
const res = await this.$axios.$get(`${api.shows}`, { ...info });
|
|
return res;
|
|
return res;
|
|
},
|
|
},
|
|
- async create({ commit }, payload) {
|
|
|
|
- const res = await this.$axios.$post(`${api.site}`, payload);
|
|
|
|
- return res;
|
|
|
|
- },
|
|
|
|
- async fetch({ commit }, payload) {
|
|
|
|
- const res = await this.$axios.$get(`${api.site}/${payload}`);
|
|
|
|
- return res;
|
|
|
|
- },
|
|
|
|
- async update({ commit }, { id, ...data }) {
|
|
|
|
- const res = await this.$axios.$post(`${api.site}/update/${id}`, data);
|
|
|
|
- return res;
|
|
|
|
- },
|
|
|
|
- async delete({ commit }, payload) {
|
|
|
|
- const res = await this.$axios.$delete(`${api.site}/${payload}`);
|
|
|
|
- return res;
|
|
|
|
- },
|
|
|
|
};
|
|
};
|
|
export default {
|
|
export default {
|
|
namespaced: true,
|
|
namespaced: true,
|