|
@@ -3,30 +3,30 @@ import Vuex from 'vuex';
|
|
import _ from 'lodash';
|
|
import _ from 'lodash';
|
|
Vue.use(Vuex);
|
|
Vue.use(Vuex);
|
|
const api = {
|
|
const api = {
|
|
- class: `/api/class`,
|
|
|
|
|
|
+ interface: `/api/class`,
|
|
};
|
|
};
|
|
const state = () => ({});
|
|
const state = () => ({});
|
|
const mutations = {};
|
|
const mutations = {};
|
|
|
|
|
|
const actions = {
|
|
const actions = {
|
|
async query({ commit }, { skip = 0, limit = this.$limit, ...info }) {
|
|
async query({ commit }, { skip = 0, limit = this.$limit, ...info }) {
|
|
- const res = await this.$axios.$get(`${api.class}`, { skip, limit, ...info });
|
|
|
|
|
|
+ const res = await this.$axios.$get(`${api.interface}`, { skip, limit, ...info });
|
|
return res;
|
|
return res;
|
|
},
|
|
},
|
|
async create({ commit }, payload) {
|
|
async create({ commit }, payload) {
|
|
- const res = await this.$axios.$post(`${api.class}`, payload);
|
|
|
|
|
|
+ const res = await this.$axios.$post(`${api.interface}`, payload);
|
|
return res;
|
|
return res;
|
|
},
|
|
},
|
|
async fetch({ commit }, payload) {
|
|
async fetch({ commit }, payload) {
|
|
- const res = await this.$axios.$get(`${api.class}/${payload}`);
|
|
|
|
|
|
+ const res = await this.$axios.$get(`${api.interface}/${payload}`);
|
|
return res;
|
|
return res;
|
|
},
|
|
},
|
|
async update({ commit }, { id, ...data }) {
|
|
async update({ commit }, { id, ...data }) {
|
|
- const res = await this.$axios.$post(`${api.class}/update/${id}`, data);
|
|
|
|
|
|
+ const res = await this.$axios.$post(`${api.interface}/update/${id}`, data);
|
|
return res;
|
|
return res;
|
|
},
|
|
},
|
|
async delete({ commit }, payload) {
|
|
async delete({ commit }, payload) {
|
|
- const res = await this.$axios.$delete(`${api.class}/${payload}`);
|
|
|
|
|
|
+ const res = await this.$axios.$delete(`${api.interface}/${payload}`);
|
|
return res;
|
|
return res;
|
|
},
|
|
},
|
|
};
|
|
};
|