export default {
	state: {
		token:"",
		userInfo : {}, //用户信息
	},

	mutations: {
		onAuth(state){
			
			
		},
		
		setUserInfo(state,obj){
			state.userInfo = obj.userInfo
			state.token = obj.token
		},
		logout(state){
			uni.showModal({
				title: '确认退出登录吗',
				success(r) {
					if(r.confirm){
						state.userInfo = {}
						state.token = ""
						uni.removeStorageSync('token')
						uni.redirectTo({
							url: '/pages/index/index'
						})
					}
				}
			})
		},
	},

	actions: {}
}