import { defineStore } from 'pinia';

export const useUserStore = defineStore('user', {
	state: () => ({
		globalParameter: {
			authCode: '',
			userName: '',
			zjhm: '',
			isLeader: false,
		}
	}),
	getters: {
		getGlobalParameter() {
			return this.globalParameter
		}
	},
	actions: {
		setGlobalParameter(param : { authCode : string, userName : string, zjhm : string, isLeader : boolean }) {
			this.globalParameter = param
		}
	},
	persist: {
		storage: sessionStorage
	},
});