liuying
2025-09-24 6efa5f6ca7536a37e3af3592bb42db63bcb8371d
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
43
44
45
<template>
    <full-page-layout :safety="false">
        <view class="start-page">
            <u-loading-icon size="80" color="#333"></u-loading-icon>
        </view>
    </full-page-layout>
</template>
 
<script>
import FullPageLayout from '@/components/FullPageLayout.vue'
 
let timeOutTask = null;
 
export default {
    name:'startPage',
    components:{FullPageLayout},
    onReady(){
        let token = this.$store.getters['user/getToken'];
        let gopage = this.$config.path.login
        if (token) {
            gopage = this.$config.path.home
        }
        timeOutTask = setTimeout(()=>{
            uni.navigateTo({url:gopage})
        },5*1000)
    },
    onUnload(){
        try{
            clearTimeout(timeOutTask)
        }catch(e){
            //TODO handle the exception
        }
    }
}
</script>
 
<style scoped lang="scss">
.start-page{
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: $uni-bg-color-mask;
}
</style>