Hello I want to redirect routing my login component page to the dashboard component with successful login. I have done a response through my local API having a status code 400 & status code 200 but don't know how to redirect after the successfully login.
Here is the component script code: import axios from 'axios'
export default {
name: 'Login',
data () {
return {
email: '',
password: '',
error: ''
}
},
methods: {
login () {
axios.post('http://ztlab01/db-admin/app/v1/login', {
email: this.email,
password: this.password
}, {'Access-Control-Allow-Origin': '*'})
.then((response) => {
console.log(response.data)
if (response.data.code === 400) {
this.error = 'Invalid Credentials'
}
if (response.data.code === 200) {
this.error = ''
}
})
.catch(error => {
console.log(error)
})
}
}
}