| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- // import Vue from 'vue'
- // import Vuex from 'vuex'
- import axios from 'axios'
- // Vue.use(Vuex)
- export const state = () => ({
- wordpressAPI: 'https://open.api.luojigou.vip',
- newsNav: [
- // {
- // icon: require('~/assets/images/news/cate_01.png'),
- // title: '中德资讯',
- // id: 1
- // },
- // {
- // icon: require('~/assets/images/news/cate_02.png'),
- // title: '行业动态',
- // id: 2
- // },
- // {
- // icon: require('~/assets/images/news/cate_03.png'),
- // title: '门店动态',
- // id: 3
- // }
- ],
- })
- export const mutations = {
- setNav(state, data){
- state.newsNav = data
- },
- };
- export const getters = {
- };
- export const actions = {
- async nuxtServerInit({commit,state,req}) {
- let newsNav = [];
- const { data } = await axios(`${state.wordpressAPI}/official-api/article/type`);
- if(data.status === 200) {
- newsNav = data.data;
- }
- commit('setNav', newsNav);
- // //产品导航
- // let headProdNav = await axios(`${state.wordpressAPI}/proCategory/showAll/main`);
- // commit('setHeadProdNav',headProdNav.data);
- // //新闻导航
- // let headNewsNav = await axios(`${state.wordpressAPI}/articleCategory/getAll`);
- // commit('setHeadNewsNav',headNewsNav.data);
- // //招聘导航
- // let headJobNav = await axios(`${state.wordpressAPIForJob}/jobClass/getAll`);
- // commit('setHeadJobNav',headJobNav.data);
- // //友情链接
- // let indexLinksData = await axios(`${state.wordpressAPI}/link/selectAll`);
- // commit('setIndexLinksData',indexLinksData.data);
- }
- };
- // export default {
- // state,
- // getters,
- // mutations,
- // actions
- // }
- // const store = () => new Vuex.Store({
- // state,
- // getters,
- // mutations,
- // actions
- // })
- // export default store
|