
const state = {
  userInfo: {},
  token:''
}

const mutations = {
  SET_USER_INFO: (state, obj) => {
    state.userInfo = Object.assign(state.userInfo,obj) 
  },
  SET_TOKEN : (state, token) => {
	state.token = token
  },
  SET_NoticeSetting : (state, obj) => {
	state.userInfo.noticeSetting = obj
  },
}

const actions = {
  login({ commit }, userInfo) {
    
  },

  setInfo({ commit, state },obj) {
	 commit('SET_USER_INFO', obj)
  },
  
  setNoticeSetting({ commit, state },obj) {
  	 commit('SET_NoticeSetting', obj)
  },
  
  setToken({ commit, state },token) {
  	 commit('SET_TOKEN', token)
  },
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}
