export default new Vuex.Store({
  state: {
    projectName: {
      Default: '前端基础框架'
    },
    layoutType: localStorage.getItem("layoutType") || 'hybridMenu',   //布局类型
    menuList: JSON.parse(sessionStorage.getItem('menuList')),
    user: JSON.parse(sessionStorage.getItem('user')),  //用户信息
    token: sessionStorage.getItem('token'),
    baseURL: process.env.VUE_APP_PORT || '',
    env: process.env || {},
    ucLoginUrl: process.env.VUE_APP_PORT_DEMO+'/authentication' || '',   // 用户中心登录接口
    fullscreenLoading: false
  },
  mutations: {
    projectName (state, payload) {
      state.projectName = payload
    },
    layoutType (state, payload) {
      state.layoutType = payload
    },
    menuList (state, payload) {
      state.menuList = payload
    },
    token (state, payload) {
      state.token = payload
    },
    user (state, payload) {
      state.user = payload
    }
  },
  getters: {
    getToken: (state) =>  () => {return state}
  },
  actions: {
  },
  modules: {
  }
})
