mirror of
https://github.com/h3poteto/whalebird-desktop
synced 2025-01-11 16:35:09 +01:00
refs #7 Add loading when get accounts list
This commit is contained in:
parent
29d37d6489
commit
375dfab154
@ -38,11 +38,19 @@ export default {
|
||||
})
|
||||
},
|
||||
created () {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
this.$store.dispatch('GlobalHeader/listAccounts')
|
||||
.then((accounts) => {
|
||||
loading.close()
|
||||
return this.$router.push({ path: `/${accounts[0]._id}/home` })
|
||||
})
|
||||
.catch(() => {
|
||||
loading.close()
|
||||
return this.$router.push({ path: '/login' })
|
||||
})
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user