import { defineStore } from 'pinia'
import { ref } from 'vue'

// 用户模块 token setToken removeToken
export const useUserStore = defineStore(
  'big-user',
  () => {
    const user = ref({})
    const token = ref()
    const setUser = (obj) => {
      user.value = { ...obj }
    }
    const setToken = (obj) => {
      token.value = obj
    }
    return {
      user,
      token,
      setUser,
      setToken
    }
  },
  {
    persist: true
  }
)
