Files
urldb/web/pages/admin.vue

466 lines
20 KiB
Vue
Raw Normal View History

2025-07-10 13:58:28 +08:00
<template>
2025-07-11 00:49:41 +08:00
<div class="min-h-screen bg-gray-50 dark:bg-gray-900 text-gray-800 dark:text-gray-100 p-3 sm:p-5">
2025-07-11 02:30:57 +08:00
<!-- 全局加载状态 -->
<div v-if="pageLoading" class="fixed inset-0 bg-gray-900 bg-opacity-50 flex items-center justify-center z-50">
<div class="bg-white dark:bg-gray-800 rounded-lg p-8 shadow-xl">
<div class="flex flex-col items-center space-y-4">
<div class="animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600"></div>
<div class="text-center">
<h3 class="text-lg font-semibold text-gray-900 dark:text-gray-100">正在加载...</h3>
<p class="text-sm text-gray-600 dark:text-gray-400 mt-1">请稍候正在初始化管理后台</p>
</div>
</div>
</div>
</div>
2025-07-10 13:58:28 +08:00
<div class="max-w-7xl mx-auto">
<!-- 头部 -->
<div class="bg-slate-800 text-white rounded-lg shadow-lg p-4 sm:p-8 mb-4 sm:mb-8 text-center">
2025-07-10 15:07:29 +08:00
<div class="flex justify-between items-center mb-4">
<h1 class="text-2xl sm:text-3xl font-bold">
2025-07-11 02:30:57 +08:00
<NuxtLink to="/" class="text-white hover:text-gray-200 dark:hover:text-gray-300 no-underline">
{{ systemConfig?.site_title || '网盘资源管理系统' }}
</NuxtLink>
2025-07-10 15:07:29 +08:00
</h1>
2025-07-10 21:14:17 +08:00
<div class="flex items-center gap-4">
<div class="text-sm">
<span>欢迎{{ userStore.userInfo?.username }}</span>
<span class="ml-2 px-2 py-1 bg-blue-600 rounded text-xs">{{ userStore.userInfo?.role }}</span>
</div>
<button
@click="handleLogout"
class="px-3 py-1 bg-red-600 hover:bg-red-700 rounded text-sm transition-colors"
>
退出登录
</button>
2025-07-10 15:07:29 +08:00
</div>
</div>
2025-07-10 13:58:28 +08:00
<nav class="mt-4 flex flex-col sm:flex-row justify-center gap-2 sm:gap-4">
<NuxtLink
to="/"
class="w-full sm:w-auto px-4 py-2 bg-blue-600 hover:bg-blue-700 rounded-md transition-colors text-center flex items-center justify-center gap-2"
>
<i class="fas fa-home"></i> 返回首页
</NuxtLink>
2025-07-12 08:15:25 +08:00
<NuxtLink
to="/add-resource"
2025-07-10 13:58:28 +08:00
class="w-full sm:w-auto px-4 py-2 bg-green-600 hover:bg-green-700 rounded-md transition-colors text-center flex items-center justify-center gap-2"
>
<i class="fas fa-plus"></i> 添加资源
2025-07-12 08:15:25 +08:00
</NuxtLink>
2025-07-10 13:58:28 +08:00
</nav>
</div>
<!-- 管理功能区域 -->
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 mb-8">
<!-- 资源管理 -->
2025-07-11 00:49:41 +08:00
<div class="bg-white dark:bg-gray-800 rounded-lg shadow p-6">
2025-07-10 13:58:28 +08:00
<div class="flex items-center mb-4">
<div class="p-3 bg-blue-100 rounded-lg">
<i class="fas fa-cloud text-blue-600 text-xl"></i>
</div>
<div class="ml-4">
2025-07-11 00:49:41 +08:00
<h3 class="text-lg font-semibold text-gray-900 dark:text-gray-100">资源管理</h3>
<p class="text-sm text-gray-600 dark:text-gray-400">管理所有资源</p>
2025-07-10 13:58:28 +08:00
</div>
</div>
<div class="space-y-2">
2025-07-16 12:39:10 +08:00
<NuxtLink to="/resources" class="w-full text-left p-3 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors block">
2025-07-10 13:58:28 +08:00
<div class="flex items-center justify-between">
2025-07-11 00:49:41 +08:00
<span class="text-sm font-medium text-gray-700 dark:text-gray-200">查看所有资源</span>
2025-07-10 13:58:28 +08:00
<i class="fas fa-chevron-right text-gray-400"></i>
</div>
2025-07-16 12:39:10 +08:00
</NuxtLink>
2025-07-12 08:15:25 +08:00
<NuxtLink to="/add-resource" class="w-full text-left p-3 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors block">
2025-07-10 13:58:28 +08:00
<div class="flex items-center justify-between">
2025-07-12 08:15:25 +08:00
<span class="text-sm font-medium text-gray-700 dark:text-gray-200">批量添加资源</span>
2025-07-10 13:58:28 +08:00
<i class="fas fa-plus text-gray-400"></i>
</div>
2025-07-12 08:15:25 +08:00
</NuxtLink>
2025-07-10 13:58:28 +08:00
</div>
</div>
<!-- 平台管理 -->
2025-07-11 00:49:41 +08:00
<div class="bg-white dark:bg-gray-800 rounded-lg shadow p-6">
2025-07-10 13:58:28 +08:00
<div class="flex items-center mb-4">
<div class="p-3 bg-green-100 rounded-lg">
<i class="fas fa-server text-green-600 text-xl"></i>
</div>
<div class="ml-4">
2025-07-11 00:49:41 +08:00
<h3 class="text-lg font-semibold text-gray-900 dark:text-gray-100">平台管理</h3>
2025-07-16 10:54:00 +08:00
<p class="text-sm text-gray-600 dark:text-gray-400">暂不支持修改</p>
2025-07-10 13:58:28 +08:00
</div>
</div>
<div class="space-y-2">
2025-07-11 00:49:41 +08:00
<button @click="goToPlatformManagement" class="w-full text-left p-3 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors">
2025-07-10 13:58:28 +08:00
<div class="flex items-center justify-between">
2025-07-11 00:49:41 +08:00
<span class="text-sm font-medium text-gray-700 dark:text-gray-200">管理平台</span>
2025-07-10 13:58:28 +08:00
<i class="fas fa-chevron-right text-gray-400"></i>
</div>
</button>
2025-07-11 00:49:41 +08:00
<button @click="showAddPlatformModal = true" class="w-full text-left p-3 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors">
2025-07-10 13:58:28 +08:00
<div class="flex items-center justify-between">
2025-07-11 00:49:41 +08:00
<span class="text-sm font-medium text-gray-700 dark:text-gray-200">添加平台</span>
2025-07-10 13:58:28 +08:00
<i class="fas fa-plus text-gray-400"></i>
</div>
</button>
</div>
</div>
2025-07-16 19:00:56 +08:00
<!-- 第三方平台账号管理 -->
<div class="bg-white dark:bg-gray-800 rounded-lg shadow p-6">
<div class="flex items-center mb-4">
<div class="p-3 bg-teal-100 rounded-lg">
<i class="fas fa-key text-teal-600 text-xl"></i>
</div>
<div class="ml-4">
<h3 class="text-lg font-semibold text-gray-900 dark:text-gray-100">平台账号管理</h3>
<p class="text-sm text-gray-600 dark:text-gray-400">管理第三方平台账号</p>
</div>
</div>
<div class="space-y-2">
<NuxtLink to="/cks" class="w-full text-left p-3 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors block">
<div class="flex items-center justify-between">
<span class="text-sm font-medium text-gray-700 dark:text-gray-200">管理账号</span>
<i class="fas fa-chevron-right text-gray-400"></i>
</div>
</NuxtLink>
<NuxtLink to="/cks" class="w-full text-left p-3 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors block">
<div class="flex items-center justify-between">
<span class="text-sm font-medium text-gray-700 dark:text-gray-200">添加账号</span>
<i class="fas fa-plus text-gray-400"></i>
</div>
</NuxtLink>
</div>
</div>
2025-07-10 13:58:28 +08:00
<!-- 分类管理 -->
2025-07-11 00:49:41 +08:00
<div class="bg-white dark:bg-gray-800 rounded-lg shadow p-6">
2025-07-10 13:58:28 +08:00
<div class="flex items-center mb-4">
<div class="p-3 bg-purple-100 rounded-lg">
<i class="fas fa-folder text-purple-600 text-xl"></i>
</div>
<div class="ml-4">
2025-07-11 00:49:41 +08:00
<h3 class="text-lg font-semibold text-gray-900 dark:text-gray-100">分类管理</h3>
<p class="text-sm text-gray-600 dark:text-gray-400">管理资源分类</p>
2025-07-10 13:58:28 +08:00
</div>
</div>
<div class="space-y-2">
2025-07-11 00:49:41 +08:00
<button @click="goToCategoryManagement" class="w-full text-left p-3 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors">
2025-07-10 13:58:28 +08:00
<div class="flex items-center justify-between">
2025-07-11 00:49:41 +08:00
<span class="text-sm font-medium text-gray-700 dark:text-gray-200">管理分类</span>
2025-07-10 13:58:28 +08:00
<i class="fas fa-chevron-right text-gray-400"></i>
</div>
</button>
2025-07-16 08:29:49 +08:00
<button @click="goToAddCategory" class="w-full text-left p-3 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors">
2025-07-10 13:58:28 +08:00
<div class="flex items-center justify-between">
2025-07-11 00:49:41 +08:00
<span class="text-sm font-medium text-gray-700 dark:text-gray-200">添加分类</span>
2025-07-10 13:58:28 +08:00
<i class="fas fa-plus text-gray-400"></i>
</div>
</button>
</div>
</div>
<!-- 标签管理 -->
2025-07-11 00:49:41 +08:00
<div class="bg-white dark:bg-gray-800 rounded-lg shadow p-6">
2025-07-10 13:58:28 +08:00
<div class="flex items-center mb-4">
<div class="p-3 bg-orange-100 rounded-lg">
<i class="fas fa-tags text-orange-600 text-xl"></i>
</div>
<div class="ml-4">
2025-07-11 00:49:41 +08:00
<h3 class="text-lg font-semibold text-gray-900 dark:text-gray-100">标签管理</h3>
<p class="text-sm text-gray-600 dark:text-gray-400">管理资源标签</p>
2025-07-10 13:58:28 +08:00
</div>
</div>
<div class="space-y-2">
2025-07-11 00:49:41 +08:00
<button @click="goToTagManagement" class="w-full text-left p-3 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors">
2025-07-10 13:58:28 +08:00
<div class="flex items-center justify-between">
2025-07-11 00:49:41 +08:00
<span class="text-sm font-medium text-gray-700 dark:text-gray-200">管理标签</span>
2025-07-10 13:58:28 +08:00
<i class="fas fa-chevron-right text-gray-400"></i>
</div>
</button>
2025-07-16 08:29:49 +08:00
<button @click="goToAddTag" class="w-full text-left p-3 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors">
2025-07-10 13:58:28 +08:00
<div class="flex items-center justify-between">
2025-07-11 00:49:41 +08:00
<span class="text-sm font-medium text-gray-700 dark:text-gray-200">添加标签</span>
2025-07-10 13:58:28 +08:00
<i class="fas fa-plus text-gray-400"></i>
</div>
</button>
</div>
</div>
<!-- 统计信息 -->
2025-07-11 00:49:41 +08:00
<div class="bg-white dark:bg-gray-800 rounded-lg shadow p-6">
2025-07-10 13:58:28 +08:00
<div class="flex items-center mb-4">
<div class="p-3 bg-red-100 rounded-lg">
<i class="fas fa-chart-bar text-red-600 text-xl"></i>
</div>
<div class="ml-4">
2025-07-11 00:49:41 +08:00
<h3 class="text-lg font-semibold text-gray-900 dark:text-gray-100">统计信息</h3>
<p class="text-sm text-gray-600 dark:text-gray-400">系统统计数据</p>
2025-07-10 13:58:28 +08:00
</div>
</div>
<div class="space-y-3">
<div class="flex justify-between items-center">
2025-07-11 00:49:41 +08:00
<span class="text-sm text-gray-600 dark:text-gray-400">总资源数</span>
<span class="text-lg font-semibold text-gray-900 dark:text-gray-100">{{ stats?.total_resources || 0 }}</span>
2025-07-10 13:58:28 +08:00
</div>
<div class="flex justify-between items-center">
2025-07-11 00:49:41 +08:00
<span class="text-sm text-gray-600 dark:text-gray-400">总浏览量</span>
<span class="text-lg font-semibold text-gray-900 dark:text-gray-100">{{ stats?.total_views || 0 }}</span>
2025-07-10 13:58:28 +08:00
</div>
<div class="flex justify-between items-center">
2025-07-11 00:49:41 +08:00
<span class="text-sm text-gray-600 dark:text-gray-400">分类数量</span>
<span class="text-lg font-semibold text-gray-900 dark:text-gray-100">{{ stats?.total_categories || 0 }}</span>
2025-07-10 13:58:28 +08:00
</div>
</div>
</div>
<!-- 待处理资源 -->
2025-07-11 00:49:41 +08:00
<div class="bg-white dark:bg-gray-800 rounded-lg shadow p-6">
2025-07-10 13:58:28 +08:00
<div class="flex items-center mb-4">
<div class="p-3 bg-yellow-100 rounded-lg">
<i class="fas fa-clock text-yellow-600 text-xl"></i>
</div>
<div class="ml-4">
2025-07-11 00:49:41 +08:00
<h3 class="text-lg font-semibold text-gray-900 dark:text-gray-100">待处理资源</h3>
<p class="text-sm text-gray-600 dark:text-gray-400">批量添加和管理</p>
2025-07-10 13:58:28 +08:00
</div>
</div>
<div class="space-y-2">
2025-07-11 00:49:41 +08:00
<NuxtLink to="/ready-resources" class="w-full text-left p-3 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors block">
2025-07-10 13:58:28 +08:00
<div class="flex items-center justify-between">
2025-07-11 00:49:41 +08:00
<span class="text-sm font-medium text-gray-700 dark:text-gray-200">管理待处理资源</span>
2025-07-10 13:58:28 +08:00
<i class="fas fa-chevron-right text-gray-400"></i>
</div>
</NuxtLink>
2025-07-11 00:49:41 +08:00
<button @click="goToBatchAdd" class="w-full text-left p-3 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors">
2025-07-10 13:58:28 +08:00
<div class="flex items-center justify-between">
2025-07-11 00:49:41 +08:00
<span class="text-sm font-medium text-gray-700 dark:text-gray-200">批量添加资源</span>
2025-07-10 13:58:28 +08:00
<i class="fas fa-plus text-gray-400"></i>
</div>
</button>
</div>
</div>
2025-07-10 21:14:17 +08:00
<!-- 搜索统计 -->
2025-07-11 00:49:41 +08:00
<div class="bg-white dark:bg-gray-800 rounded-lg shadow p-6">
2025-07-10 21:14:17 +08:00
<div class="flex items-center mb-4">
2025-07-11 00:49:41 +08:00
<div class="p-3 bg-indigo-100 dark:bg-indigo-900 rounded-lg">
<i class="fas fa-search text-indigo-600 dark:text-indigo-300 text-xl"></i>
2025-07-10 21:14:17 +08:00
</div>
<div class="ml-4">
2025-07-11 00:49:41 +08:00
<h3 class="text-lg font-semibold text-gray-900 dark:text-gray-100">搜索统计</h3>
<p class="text-sm text-gray-600 dark:text-gray-400">搜索量分析和热门关键词</p>
2025-07-10 21:14:17 +08:00
</div>
</div>
<div class="space-y-2">
2025-07-11 00:49:41 +08:00
<NuxtLink to="/search-stats" class="w-full text-left p-3 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors block">
2025-07-10 21:14:17 +08:00
<div class="flex items-center justify-between">
2025-07-11 00:49:41 +08:00
<span class="text-sm font-medium text-gray-700 dark:text-gray-200">查看搜索统计</span>
<i class="fas fa-chart-line text-gray-400 dark:text-gray-300"></i>
2025-07-10 21:14:17 +08:00
</div>
</NuxtLink>
2025-07-11 00:49:41 +08:00
<button @click="goToHotKeywords" class="w-full text-left p-3 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors">
2025-07-10 21:14:17 +08:00
<div class="flex items-center justify-between">
2025-07-11 00:49:41 +08:00
<span class="text-sm font-medium text-gray-700 dark:text-gray-200">热门关键词</span>
<i class="fas fa-fire text-gray-400 dark:text-gray-300"></i>
2025-07-10 21:14:17 +08:00
</div>
</button>
</div>
</div>
2025-07-10 13:58:28 +08:00
<!-- 系统设置 -->
2025-07-11 00:49:41 +08:00
<div class="bg-white dark:bg-gray-800 rounded-lg shadow p-6">
2025-07-10 13:58:28 +08:00
<div class="flex items-center mb-4">
2025-07-11 00:49:41 +08:00
<div class="p-3 bg-gray-100 dark:bg-gray-700 rounded-lg">
<i class="fas fa-cog text-gray-600 dark:text-gray-300 text-xl"></i>
2025-07-10 13:58:28 +08:00
</div>
<div class="ml-4">
2025-07-11 00:49:41 +08:00
<h3 class="text-lg font-semibold text-gray-900 dark:text-gray-100">系统设置</h3>
<p class="text-sm text-gray-600 dark:text-gray-400">系统配置</p>
2025-07-10 13:58:28 +08:00
</div>
</div>
<div class="space-y-2">
2025-07-11 00:49:41 +08:00
<button @click="goToSystemSettings" class="w-full text-left p-3 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors">
2025-07-10 13:58:28 +08:00
<div class="flex items-center justify-between">
2025-07-11 00:49:41 +08:00
<span class="text-sm font-medium text-gray-700 dark:text-gray-200">系统配置</span>
<i class="fas fa-chevron-right text-gray-400 dark:text-gray-300"></i>
2025-07-10 13:58:28 +08:00
</div>
</button>
2025-07-11 00:49:41 +08:00
<button @click="goToUserManagement" class="w-full text-left p-3 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors">
2025-07-10 13:58:28 +08:00
<div class="flex items-center justify-between">
2025-07-11 00:49:41 +08:00
<span class="text-sm font-medium text-gray-700 dark:text-gray-200">用户管理</span>
<i class="fas fa-users text-gray-400 dark:text-gray-300"></i>
2025-07-10 13:58:28 +08:00
</div>
</button>
</div>
</div>
</div>
2025-07-10 15:07:29 +08:00
</div>
2025-07-10 13:58:28 +08:00
</div>
</template>
2025-07-10 15:07:29 +08:00
<script setup>
2025-07-10 21:14:17 +08:00
definePageMeta({
middleware: 'auth'
})
2025-07-11 02:30:57 +08:00
// API
const { getSystemConfig } = useSystemConfigApi()
2025-07-10 15:07:29 +08:00
const router = useRouter()
2025-07-10 21:14:17 +08:00
const userStore = useUserStore()
2025-07-10 15:07:29 +08:00
const { $api } = useNuxtApp()
2025-07-10 13:58:28 +08:00
2025-07-10 15:07:29 +08:00
const user = ref(null)
const stats = ref(null)
2025-07-16 12:39:10 +08:00
const platforms = ref([])
2025-07-11 02:30:57 +08:00
const pageLoading = ref(true) // 添加页面加载状态
const systemConfig = ref(null) // 添加系统配置状态
// 页面元数据 - 移到变量声明之后
useHead({
title: () => systemConfig.value?.site_title ? `${systemConfig.value.site_title} - 管理后台` : '管理后台 - 网盘资源管理系统',
meta: [
{
name: 'description',
content: () => systemConfig.value?.site_description || '网盘资源管理系统管理后台'
},
{
name: 'keywords',
content: () => systemConfig.value?.keywords || '网盘,资源管理,管理后台'
},
{
name: 'author',
content: () => systemConfig.value?.author || '系统管理员'
}
]
})
// 获取系统配置
const fetchSystemConfig = async () => {
try {
const response = await getSystemConfig()
console.log('admin系统配置响应:', response)
2025-07-11 17:45:16 +08:00
// 使用新的统一响应格式直接使用response
if (response) {
systemConfig.value = response
2025-07-11 02:30:57 +08:00
}
} catch (error) {
console.error('获取系统配置失败:', error)
}
}
2025-07-10 13:58:28 +08:00
2025-07-10 15:07:29 +08:00
// 检查认证状态
const checkAuth = () => {
2025-07-11 02:30:57 +08:00
console.log('admin - checkAuth 开始')
2025-07-16 12:39:10 +08:00
// 中间件已经处理了认证检查,这里只需要确保用户状态已初始化
if (!userStore.isAuthenticated) {
userStore.initAuth()
}
2025-07-10 15:07:29 +08:00
2025-07-11 02:30:57 +08:00
console.log('admin - isAuthenticated:', userStore.isAuthenticated)
console.log('admin - user:', userStore.userInfo)
2025-07-16 12:39:10 +08:00
console.log('admin - 认证检查完成')
2025-07-10 15:07:29 +08:00
}
2025-07-10 13:58:28 +08:00
2025-07-10 15:07:29 +08:00
// 获取统计信息
const fetchStats = async () => {
try {
2025-07-16 12:39:10 +08:00
const { useResourceApi } = await import('~/composables/useApi')
const resourceApi = useResourceApi()
const response = await resourceApi.getResources({ page: 1, page_size: 1 })
// 这里只取stats字段
stats.value = response.stats || null
2025-07-10 15:07:29 +08:00
} catch (error) {
console.error('获取统计信息失败:', error)
}
2025-07-10 13:58:28 +08:00
}
2025-07-16 12:39:10 +08:00
// 获取平台列表
const fetchPlatforms = async () => {
try {
const { usePanApi } = await import('~/composables/useApi')
const panApi = usePanApi()
const response = await panApi.getPans()
platforms.value = Array.isArray(response) ? response : []
console.log('获取到的平台数据:', platforms.value)
} catch (error) {
console.error('获取平台列表失败:', error)
platforms.value = []
}
}
2025-07-10 15:07:29 +08:00
// 退出登录
const handleLogout = () => {
2025-07-10 21:14:17 +08:00
userStore.logout()
router.push('/')
2025-07-10 13:58:28 +08:00
}
2025-07-10 15:07:29 +08:00
// 页面跳转方法
const goToResourceManagement = () => {
// 实现资源管理页面跳转
2025-07-10 13:58:28 +08:00
}
2025-07-10 15:07:29 +08:00
const goToPlatformManagement = () => {
// 实现平台管理页面跳转
2025-07-10 13:58:28 +08:00
}
2025-07-10 15:07:29 +08:00
const goToCategoryManagement = () => {
2025-07-16 08:29:49 +08:00
router.push('/categories')
2025-07-10 13:58:28 +08:00
}
2025-07-10 15:07:29 +08:00
const goToTagManagement = () => {
2025-07-16 08:29:49 +08:00
router.push('/tags')
}
// 新增:跳转到分类管理并打开新增弹窗
const goToAddCategory = () => {
router.push('/categories?action=add')
}
// 新增:跳转到标签管理并打开新增弹窗
const goToAddTag = () => {
router.push('/tags?action=add')
2025-07-10 13:58:28 +08:00
}
const goToBatchAdd = () => {
2025-07-10 15:07:29 +08:00
router.push('/ready-resources')
2025-07-10 13:58:28 +08:00
}
2025-07-10 15:07:29 +08:00
const goToSystemSettings = () => {
2025-07-11 02:30:57 +08:00
router.push('/system-config')
2025-07-10 13:58:28 +08:00
}
2025-07-10 15:07:29 +08:00
const goToUserManagement = () => {
router.push('/users')
2025-07-10 13:58:28 +08:00
}
2025-07-10 15:07:29 +08:00
2025-07-10 21:14:17 +08:00
const goToHotKeywords = () => {
router.push('/search-stats')
}
2025-07-10 15:07:29 +08:00
// 页面加载时检查认证
2025-07-11 02:30:57 +08:00
onMounted(async () => {
try {
2025-07-16 12:39:10 +08:00
// 移除checkAuth调用因为中间件已经处理了认证
// checkAuth()
2025-07-11 02:30:57 +08:00
await Promise.all([
fetchStats(),
2025-07-16 12:39:10 +08:00
fetchSystemConfig(),
fetchPlatforms()
2025-07-11 02:30:57 +08:00
])
} catch (error) {
console.error('admin页面初始化失败:', error)
} finally {
// 所有数据加载完成后,关闭加载状态
pageLoading.value = false
}
2025-07-10 15:07:29 +08:00
})
2025-07-10 13:58:28 +08:00
</script>
<style scoped>
/* 可以添加自定义样式 */
</style>