[...all].vue
1.33 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<route lang="yaml">
name: notFound
meta:
title: 数据资产管理
constant: true
layout: false
</route>
<script lang="ts" setup>
import useUserStore from '@/store/modules/user';
const userStore = useUserStore()
const router = useRouter()
const data = ref({
inter: NaN,
countdown: 5,
})
onBeforeRouteLeave(() => {
data.value.inter && clearInterval(data.value.inter)
})
onMounted(() => {
// data.value.inter = setInterval(() => {
// data.value.countdown--
// if (data.value.countdown === 0) {
// data.value.inter && clearInterval(data.value.inter)
// goBack()
// }
// }, 1000)
goBack()
})
function goBack() {
if (userStore.getTokenPromise) {
userStore.getTokenPromise.then(() => {
router.push('/')
});
} else {
router.push('/')
}
}
</script>
<template>
<div class="notfound">
<img src="../../public/swzl_logo.png">
</div>
</template>
<style lang="scss" scoped>
.notfound {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
@include position-center(xy);
.icon {
width: 400px;
height: 400px;
}
.content {
h1 {
margin: 0;
font-size: 72px;
color: var(--el-text-color-primary);
}
.desc {
margin: 20px 0 30px;
font-size: 20px;
color: var(--el-text-color-secondary);
}
}
}
</style>