import { defineStore } from 'pinia';
import { router } from '/nerv-lib/saas/router';

export const user = defineStore<
  string,
  { token: string; userName: string },
  {},
  { login: Function; logout: Function }
>({
  id: 'user',
  state: () => {
    return { token: '', userName: '111' };
  },
  getters: {
    double(): string {
      return this.userName;
    },
  },
  actions: {
    login() {},
    logout() {
      router.push('/login');
    },
  },
});
