import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    realData: {},
		loginData: {},
		unpublishedData: {},
		superior: {}
  },
  getters: {
		getRealData(state) {
			return state.realData
		},
		getLoginData(state) {
			return state.loginData
		},
		getUnpublishedData(state) {
			return state.unpublishedData
		},
		getSuperior(state) {
			return state.superior
		},
  },
  mutations: {
		changeRealData(state, payload) {
			state.realData = payload;
		},
		changeLoginData(state, payload) {
			state.loginData = payload;
		},
		changeUnpublishedData(state, payload) {
			state.unpublishedData = payload;
		},
		changeSuperior(state, payload) {
			state.superior = payload;
		},
  },
  actions: {
		changeRealData(store, payload) {
			store.commit({
				type: 'changeRealData',
				realData: payload
			})
		},
		changeLoginData(store, payload) {
			store.commit({
				type: 'changeLoginData',
				realData: payload
			})
		},
		changeUnpublishedData(store, payload) {
			store.commit({
				type: 'changeUnpublishedData',
				unpublishedData: payload
			})
		},
		changeSuperior(store, payload) {
			store.commit({
				type: 'changeSuperior',
				superior: payload
			})
		},
  },
  modules: {
  }
})
