loading.vue
801 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<template>
</template>
<script type='text/ecmascript-6'>
export default {
name: '',
data () {
return {
}
},
mounted () {
uni.showLoading()
let userInfo = uni.$storage.get('userInfo')
uni.$api.userApi.getListSelectAccount().then(res => {
uni.hideLoading()
setTimeout(() => {
if (res.code == 0 && userInfo) {
let url = {
1: '/pages/boutique/index',
0: '/pages/home/home'
}[userInfo.sceneType]
uni.reLaunch({
url
})
}
else uni.reLaunch({
url: '/pages/common/login'
})
}, 500)
}).catch(() => [
uni.reLaunch({
url: '/pages/common/login'
})
])
},
methods: {
}
}
</script>
<style scoped lang='scss'>
</style>