feat: Dashboard骨架屏+robots.txt
- Dashboard 加载骨架屏 - 添加 robots.txt - 优化前端加载体验
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
# 言逍导航
|
||||
User-agent: *
|
||||
Allow: /
|
||||
Sitemap: https://110.42.189.169:9110/sitemap.xml
|
||||
@@ -1,5 +1,11 @@
|
||||
<template>
|
||||
<div class="dashboard">
|
||||
<div v-if="loading" class="dashboard-loading">
|
||||
<el-skeleton :rows="2" animated />
|
||||
<el-skeleton style="margin-top:24px" :rows="2" animated />
|
||||
<el-skeleton style="margin-top:24px" :rows="6" animated />
|
||||
</div>
|
||||
<template v-else>
|
||||
<el-row :gutter="[16, 16]" class="stat-cards">
|
||||
<el-col :xs="12" :sm="6">
|
||||
<el-card shadow="hover">
|
||||
@@ -73,6 +79,7 @@
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from 'vue'
|
||||
@@ -82,8 +89,10 @@ import { adminApi } from '@/api'
|
||||
const stats = ref({ linkCount: 0, catCount: 0, totalViews: 0 })
|
||||
const settings = ref({})
|
||||
const categories = ref([])
|
||||
const loading = ref(true)
|
||||
|
||||
onMounted(async () => {
|
||||
try {
|
||||
const [statsRes, setRes] = await Promise.all([
|
||||
adminApi.getStats(),
|
||||
adminApi.getSettings()
|
||||
@@ -92,6 +101,9 @@ onMounted(async () => {
|
||||
stats.value = { linkCount: d.linkCount, catCount: d.categories.length, totalViews: d.totalViews }
|
||||
categories.value = d.categories
|
||||
settings.value = setRes.result.data
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user