import { api } from 'boot/axios';

export class Auth
{

  async login(user:string,pwd:string):Promise<boolean>
  {
       const params = new URLSearchParams();
       params.append('username', user);
       params.append('password', pwd);
       try{
       const result = await api.post('api/token',params);
       console.info(result);
       localStorage.setItem('Token', result.data.access_token);
       return true;
       }catch(e)
       {
        console.info(e);
        return false;
       }
  }
}
