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

export const useTokenStore = defineStore('token', () => {
  const token = ref(''); // 定义响应式变量token，初始值为空字符串
  const setToken = (newToken) => {
    token.value = newToken; // 设置token的值
  }
  const clearToken = () => {
    token.value = ''; // 清空token的值
  }
  return { token, setToken, clearToken }
})
