import {
	defineStore
} from 'pinia'

import {
	ref
} from 'vue';
export const useUserStore = defineStore('user', () => {
	const userInfo = ref(null)
	const count = ref(1)
	const projectInfo = ref({
		id: '',
		name: '',
	})

	function setUserInfo(info) {
		userInfo.value = info
	}

	function getProjectInfo(data) {
		projectInfo.value.id = data.id
		projectInfo.value.name = data.name
		uni.setStorageSync('project-info', data)
	}

	return {
		count,
		userInfo,
		setUserInfo,
		getProjectInfo,
		projectInfo
	}
})