const axios = require('axios');
export default {
    login(myusername, mypassword, callback){
        let params = new URLSearchParams();
        params.append('username', myusername);
        params.append('password', mypassword);
        axios.post('/api/login',params).then((response)=>{
            callback(response)
        })
    },
    getUserInfo(callback){
        axios.get('/api/user').then((response)=>{
            callback(response)
        })
    },
    logout(callback){
        axios.get('/api/logout').then((response)=>{
            callback(response)
        })
    }
}