2025-02-14 23:14:54 +08:00
|
|
|
<script setup>
|
2025-03-16 14:24:53 +08:00
|
|
|
import {ref, onMounted} from 'vue'
|
|
|
|
import {TransitionPresets, useTransition} from '@vueuse/core';
|
|
|
|
import api from "../utils/axios.js";
|
|
|
|
|
|
|
|
const source = ref(0);
|
|
|
|
const viewCountDisplay = ref(true);
|
|
|
|
const outputValue = useTransition(source, {
|
|
|
|
duration: 3000,
|
|
|
|
transition: TransitionPresets.easeOutExpo,
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
onMounted(async () => {
|
|
|
|
const response = await api.get('/view');
|
|
|
|
if (response.code === 0) {
|
|
|
|
source.value = response.views;
|
|
|
|
} else {
|
|
|
|
viewCountDisplay.value = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
2025-02-14 23:14:54 +08:00
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2025-03-04 19:02:35 +08:00
|
|
|
<div class="container">
|
2025-03-16 14:24:53 +08:00
|
|
|
<el-container>
|
|
|
|
<div style="font-size: 50px; font-weight: inherit; padding: 20px">欢迎来到 MVA-CYBER !</div>
|
|
|
|
<!-- <el-main>-->
|
|
|
|
|
|
|
|
<!-- </el-main>-->
|
|
|
|
<!-- <el-footer>-->
|
|
|
|
<!-- <div class="text-bg"></div>-->
|
|
|
|
<el-col v-if="viewCountDisplay">
|
|
|
|
<el-statistic title="网站累计访问次数" :value="outputValue"/>
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
<!-- </el-footer>-->
|
|
|
|
</el-container>
|
2025-02-14 23:14:54 +08:00
|
|
|
</div>
|
2025-03-04 19:02:35 +08:00
|
|
|
|
2025-02-14 23:14:54 +08:00
|
|
|
</template>
|
|
|
|
|
2025-03-04 19:02:35 +08:00
|
|
|
<style scoped>
|
2025-03-16 14:24:53 +08:00
|
|
|
img {
|
|
|
|
position: absolute;
|
2025-02-14 23:14:54 +08:00
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
}
|
2025-03-16 14:24:53 +08:00
|
|
|
.el-container {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
flex-direction: column;
|
|
|
|
width: 100%;
|
|
|
|
overflow: hidden;
|
2025-03-04 19:02:35 +08:00
|
|
|
|
2025-02-14 23:14:54 +08:00
|
|
|
}
|
2025-03-16 14:24:53 +08:00
|
|
|
.el-main {
|
|
|
|
overflow: hidden;
|
|
|
|
padding: 0;
|
|
|
|
width: 100%;
|
2025-03-04 19:02:35 +08:00
|
|
|
}
|
2025-03-16 14:24:53 +08:00
|
|
|
.el-footer {
|
|
|
|
position: relative;
|
2025-03-04 19:02:35 +08:00
|
|
|
}
|
2025-03-16 14:24:53 +08:00
|
|
|
.el-col {
|
|
|
|
position: absolute;
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
}
|
|
|
|
.el-statistic {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column-reverse;
|
|
|
|
align-items: center;
|
2025-02-14 23:14:54 +08:00
|
|
|
}
|
|
|
|
</style>
|