|
@@ -2,26 +2,37 @@ import Vue from 'vue';
|
|
import Vuex from 'vuex';
|
|
import Vuex from 'vuex';
|
|
import $request from '../lib/request.js';
|
|
import $request from '../lib/request.js';
|
|
Vue.use(Vuex);
|
|
Vue.use(Vuex);
|
|
|
|
+const baseurl = 'http://192.168.3.45:18090';
|
|
const api = {
|
|
const api = {
|
|
- imgQuery: 'http://192.168.3.45:18090/api/cms/imgnews/query'
|
|
+ imgQuery: '/api/cms/imgnews/query',
|
|
|
|
+ contentQuery: '/api/cms/contents/query'
|
|
};
|
|
};
|
|
|
|
|
|
const state = () => ({
|
|
const state = () => ({
|
|
- imgList: []
|
|
+ imgList: [],
|
|
|
|
+ contentList: []
|
|
});
|
|
});
|
|
|
|
|
|
const actions = {
|
|
const actions = {
|
|
async imgQuery({ commit }) {
|
|
async imgQuery({ commit }) {
|
|
- const res = await $request.get(api.imgQuery);
|
|
+ const res = await $request.get(`${baseurl}${api.imgQuery}`);
|
|
commit('imgQuery', res[1].data);
|
|
commit('imgQuery', res[1].data);
|
|
return res;
|
|
return res;
|
|
},
|
|
},
|
|
|
|
+ async contentQuery({ commit }, payload) {
|
|
|
|
+ const res = await $request.get(`${baseurl}${api.contentQuery}`, payload);
|
|
|
|
+ commit('contentQuery', res[1].data);
|
|
|
|
+ return res;
|
|
|
|
+ },
|
|
};
|
|
};
|
|
|
|
|
|
const mutations = {
|
|
const mutations = {
|
|
imgQuery(state, payload) {
|
|
imgQuery(state, payload) {
|
|
state.imgList = payload.data;
|
|
state.imgList = payload.data;
|
|
},
|
|
},
|
|
|
|
+ contentQuery(state, payload) {
|
|
|
|
+ state.contentList = payload.data;
|
|
|
|
+ },
|
|
};
|
|
};
|
|
|
|
|
|
export default new Vuex.Store({
|
|
export default new Vuex.Store({
|