import { defineStore } from 'pinia';

export const noticeStore = defineStore('noticeNum', {
	state: () => {
		return { data: { num: 0 } };
	},
	actions: {
		increment() {
			this.data.num++;
		},
	},
});
export const tokenStore = defineStore('token', {
	state: () => {
	  return { token: '' }
	},
	actions: {
		setToken(token){
			this.token = token
		}
	},
  })

  export const UserStore = defineStore('User', {
	state: () => {
	  return { user: {} }
	},
	// 也可以这样定义
	// state: () => ({ count: 0 })
	actions: {
		setUser(user){
			this.user = user
		}
	},
  })


  export const IMloginStore = defineStore('IMlogin', {
	state: () => {
	  return { IMstate: false }
	},
	// 也可以这样定义
	// state: () => ({ count: 0 })
	actions: {
		setIMstate(state){
			this.IMstate = state
		}
	},
  })