mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange.git
synced 2026-08-19 12:24:09 +00:00
fix login loading screen
This commit is contained in:
@@ -80,6 +80,12 @@ export default {
|
||||
|
||||
methods: {
|
||||
async login () {
|
||||
|
||||
// Submit the form.
|
||||
const { data } = await this.form.post('/api/login')
|
||||
|
||||
|
||||
// Add loading screen
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Logging in',
|
||||
@@ -87,25 +93,24 @@ export default {
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
|
||||
// Submit the form.
|
||||
const { data } = await this.form.post('/api/login')
|
||||
|
||||
// Save the token.
|
||||
this.$store.dispatch('auth/saveToken', {
|
||||
token: data.token,
|
||||
remember: this.remember
|
||||
remember: this.remember,
|
||||
})
|
||||
|
||||
// Fetch the user.
|
||||
await this.$store.dispatch('auth/fetchUser')
|
||||
|
||||
|
||||
|
||||
// Redirect home.
|
||||
if (store.getters['auth/user'].role === 'admin') {
|
||||
loading.close()
|
||||
this.$router.push({ name: 'admin.home' })
|
||||
loading.close()
|
||||
}
|
||||
loading.close()
|
||||
this.$router.push({ name: 'home' })
|
||||
loading.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
</el-row>
|
||||
<br>
|
||||
<el-row :gutter="20" type="flex" justify="center" align="middle">
|
||||
<el-col :xs="18" :sm="18" :md="8" :lg="8" :xl="8"><div class="grid-content bg-purple" align="left"><el-input type="number" v-model="booking.amount" placeholder="Amount"/></div></el-col>
|
||||
<el-col :xs="18" :sm="18" :md="8" :lg="8" :xl="8"><div class="grid-content bg-purple" align="left"><el-input v-model="booking.amount" placeholder="Amount"/></div></el-col>
|
||||
</el-row>
|
||||
<!-- Input-Amount-end -->
|
||||
<hr>
|
||||
|
||||
Reference in New Issue
Block a user