import type { UserState } from './typing';
import ls from '@/utils/local-storage';

export const state: UserState = {
  token: ls.get('token') || {},
  username: window.localStorage.getItem('username') || '',
  nickname: '',
  avatar: '',
  extra: {},
  role: undefined,
  allowRouters: [],
  menuAuth: [],
  routeAuth: [],
  id: '',
};

export const initState: UserState = Object.assign({}, state);
