export const state = {
	//用户数据
	userInfo: {},
	videoOssList:[],
	videoList:[],
};
export const mutations = {
	//储存用户信息
	setUserInfo(state, data) {
		// console.log(state)
		// console.log(data)
		if (data) {
			state.userInfo = Object.assign({}, state.userInfo, data);
			// #ifdef H5
			window.sessionStorage.setItem('userInfo', JSON.stringify(state.userInfo));
			// #endif
			// #ifndef H5
			uni.setStorageSync('userInfo', state.userInfo);
			// #endif
		}
	},
	setVideoOssList(state, data) {
		// console.log(state)
		// console.log(data)
		if (data) {
			state.videoOssList = data;
			// #ifdef H5
			window.sessionStorage.setItem('videoOssList', JSON.stringify(state.videoOssList));
			// #endif
			// #ifndef H5
			uni.setStorageSync('videoOssList', state.videoOssList);
			// #endif
		}
	},
	setVideoList(state, data) {
		// console.log(state)
		// console.log(data)
		if (data) {
			state.videoOssList = data;
			// #ifdef H5
			window.sessionStorage.setItem('videoList', JSON.stringify(state.videoList));
			// #endif
			// #ifndef H5
			uni.setStorageSync('videoList', state.videoList);
			// #endif
		}
	},
	//储存一路健康用户信息
	setHealthMes(state, data) {
		console.log(data)
		if (data) {
			state.HealthMes = Object.assign({}, state.HealthMes, data);
			// #ifdef H5
			window.sessionStorage.setItem('HealthMes', JSON.stringify(state.HealthMes));
			// #endif
			// #ifndef H5
			uni.setStorageSync('HealthMes', state.HealthMes);
			// #endif
		}
	},
	// 退出APP
	emptyUserInfo(state) {
		state.userInfo = {};
		// #ifdef H5
		window.sessionStorage.removeItem("userInfo");
		// #endif
		// #ifndef H5
		uni.removeStorageSync("userInfo");
		// #endif
	},
};
export const actions = {

};
