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