|
@@ -5,11 +5,15 @@
|
|
|
|
|
|
export const state = () => ({
|
|
|
FooterYouQingLianJie: [],
|
|
|
+ hotList: [],
|
|
|
BASE_URL: process.env.baseUrl,
|
|
|
ActiveNav: '/'
|
|
|
})
|
|
|
|
|
|
export const getters = {
|
|
|
+ getHotList(state) {
|
|
|
+ return state.hotList;
|
|
|
+ },
|
|
|
getFooterYouQingLianJie(state) {
|
|
|
return state.FooterYouQingLianJie;
|
|
|
},
|
|
@@ -28,11 +32,20 @@ export const mutations = {
|
|
|
},
|
|
|
setActiveNav(state, payload) {
|
|
|
state.ActiveNav = payload;
|
|
|
+ },
|
|
|
+ setHotList(state, payload) {
|
|
|
+ state.hotList = payload;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
+export const actions = {
|
|
|
+ async nuxtServerInit({commit}, {$axios}) {
|
|
|
+ // 初始化store
|
|
|
+ const { data:data2 } = await $axios.post('/home/news/hot');
|
|
|
+ commit('setHotList', data2.data || []);
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
|
|
|
|