| | |
| | | text-color="#666666" |
| | | active-text-color="#1E3A8A" |
| | | > |
| | | > |
| | | <el-menu-item index="/dashboard"> |
| | | <el-icon><House /></el-icon> |
| | | <span>工作台</span> |
| | |
| | | <el-icon><TrendCharts /></el-icon> |
| | | <span>比赛晋级</span> |
| | | </el-menu-item> |
| | | <el-menu-item index="/news"> |
| | | <el-icon><Document /></el-icon> |
| | | <span>新闻管理</span> |
| | | </el-menu-item> |
| | | <el-menu-item index="/carousel"> |
| | | <el-icon><Picture /></el-icon> |
| | | <span>新闻与推广</span> |
| | | <span>Banner</span> |
| | | </el-menu-item> |
| | | <el-menu-item index="/region"> |
| | | <el-icon><Location /></el-icon> |
| | |
| | | import { computed } from 'vue' |
| | | import { useRouter } from 'vue-router' |
| | | import { House, Calendar, User, Document, UserFilled, Files, TrendCharts, Picture, Location, Avatar, ArrowDown } from '@element-plus/icons-vue' |
| | | import { clearAuth, getCurrentUserDisplayName } from '@/utils/auth' |
| | | |
| | | const router = useRouter() |
| | | |
| | | const userInfo = computed(() => ({ |
| | | name: '管理员' |
| | | })) |
| | | |
| | | const currentUserName = computed(() => userInfo.value.name || '用户') |
| | | const currentUserName = computed(() => getCurrentUserDisplayName()) |
| | | |
| | | const handleCommand = (command: string) => { |
| | | switch (command) { |
| | |
| | | router.push('/profile') |
| | | break |
| | | case 'logout': |
| | | localStorage.removeItem('token') |
| | | // 清除所有认证数据 |
| | | clearAuth() |
| | | // 跳转到登录页面 |
| | | router.push('/login') |
| | | break |
| | | } |