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

Vue.use(Vuex)

const store = new Vuex.Store({
	state: {
		userInfo:null,
		token:null,
		isRefresh:true,
		kickbackData:[]
	},
	getters:{
		kickbackDataLen: state => {
			return state.kickbackData.length;
		}
	},
	mutations: {
		setData(state,{payload}){
			for (let v in payload) {
				state[v] = payload[v];
				uni.setStorageSync(v,payload[v]);
			}
		},
	},
	actions:{}
})

export default store
