export default {
	state: {
		accessToken: "",
		userInfo: {},
		versionInfo: null, // 版本信息
		systemInfo: null, // 系统信息
		packageEnv: 'prod', // 默认产线环境
	},
	mutations: {
		INIT_DATA(state, data = {}) {
			let accessToken = uni.getStorageSync('accessToken')
			let userInfo = uni.getStorageSync('userInfo')
			if (accessToken && userInfo) {
				state.accessToken = accessToken
				state.userInfo = userInfo
			}
		},
		SET_PACKAGEENV(state, env){
			state.packageEnv = env || uni.getStorageSync('packageEnv')
			uni.getStorageSync('packageEnv',env)
		},
		SET_SYSTEMINFO(state, systemInfo) {
			state.systemInfo = systemInfo
		},
		SET_VERSIONINFO(state, versionInfo) {
			state.versionInfo = versionInfo
		},
		SET_FLASHSCREEN(state, data) {
			console.log('data', data)
			state.flashScreen = data
		}
	},
	actions: {},
	getters: {
		isLogin(state){
			if(state.accessToken) {
				return true;
			} else {
				return false
			}
		}
	}
}
