You can use this simple plugin https://github.com/imcvampire/vue-axios. (This wrapper bind axios to Vue or this if you’re using single file component)
Then you can use axios like this :
import Vue from 'vue'
import { Notify, Loading } from 'quasar'
/*
export const someAction = (state) => {
}
*/
export const doLogin = (state,creds) => {
state.commit('LOGIN')
let email=creds.email
let password=creds.password
console.log(this.$axios)
return Vue.axios
.post('/auth/signin', {
email,
password
})
.then(r => {
//console.log(r)
//localStorage.setItem("token", "JWT");
commit('LOGIN_SUCCESS')
return r
})
.catch(e => {
//console.log(e.response)
Notify.create("Error: " + e.response.status)
//localStorage.removeItem("token")
commit('LOGOUT')
return e
})
}
export const doLogout = (state) => {
localStorage.removeItem("token")
commit(LOGOUT)
}