fix loading screen on login

This commit is contained in:
Jack Goh
2018-06-13 16:09:47 +08:00
parent 87442520a9
commit d2ca59eb96
+2 -4
View File
@@ -86,10 +86,6 @@ export default {
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
setTimeout(() => {
loading.close();
}, 1500);
// Submit the form.
const { data } = await this.form.post('/api/login')
@@ -105,8 +101,10 @@ export default {
// Redirect home.
if(store.getters['auth/user'].role === 'admin'){
loading.close();
this.$router.push({ name: 'admin.home' })
}
loading.close();
this.$router.push({ name: 'home' })
}
}