index.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. // import Vue from 'vue'
  2. // import Vuex from 'vuex'
  3. import axios from 'axios'
  4. // Vue.use(Vuex)
  5. export const state = () => ({
  6. wordpressAPI: 'http://visney.cn',
  7. newsNav: [
  8. {
  9. icon: require('~/assets/images/news/cate_01.png'),
  10. title: '中德资讯',
  11. id: 1
  12. },
  13. {
  14. icon: require('~/assets/images/news/cate_02.png'),
  15. title: '行业动态',
  16. id: 2
  17. },
  18. {
  19. icon: require('~/assets/images/news/cate_03.png'),
  20. title: '门店动态',
  21. id: 3
  22. }
  23. ],
  24. })
  25. export const mutations = {
  26. setNav(state, data){
  27. state.newsNav = data
  28. },
  29. };
  30. export const getters = {
  31. };
  32. export const actions = {
  33. async nuxtServerInit({commit,state,req}) {
  34. // //产品导航
  35. // let headProdNav = await axios(`${state.wordpressAPI}/proCategory/showAll/main`);
  36. // commit('setHeadProdNav',headProdNav.data);
  37. // //新闻导航
  38. // let headNewsNav = await axios(`${state.wordpressAPI}/articleCategory/getAll`);
  39. // commit('setHeadNewsNav',headNewsNav.data);
  40. // //招聘导航
  41. // let headJobNav = await axios(`${state.wordpressAPIForJob}/jobClass/getAll`);
  42. // commit('setHeadJobNav',headJobNav.data);
  43. // //友情链接
  44. // let indexLinksData = await axios(`${state.wordpressAPI}/link/selectAll`);
  45. // commit('setIndexLinksData',indexLinksData.data);
  46. }
  47. };
  48. // export default {
  49. // state,
  50. // getters,
  51. // mutations,
  52. // actions
  53. // }
  54. // const store = () => new Vuex.Store({
  55. // state,
  56. // getters,
  57. // mutations,
  58. // actions
  59. // })
  60. // export default store