Recently, I've been working on extracting a token from a URL like
http://test.com/confirm?token=MMsndiwhjidh...
and then sending a post request to another server.
This is the approach I took:
export default {
data() {
return {
confirmation : false,
somethingWrong: false
}
},
created: function() {
axios.post('/confirm', null, {
method: 'post',
params: {
token:this.$route.query.token
}
})
.then(function(res) {
console.log(res)
this.confirmation = true
})
.catch(function(error) {
console.log(error)
this.somethingWrong = true
})
}
}
During testing, I encountered the following errors:
https://i.sstatic.net/vRaKK.png
https://i.sstatic.net/vRaKK.png
It seems that there might be an issue with how I am extracting the token.