peng
2025-11-06 c4938f6f4e839890b032c75c7a57333a6a9157a9
web/src/layout/index.vue
@@ -34,7 +34,6 @@
          text-color="#666666"
          active-text-color="#1E3A8A"
        >
        >
          <el-menu-item index="/dashboard">
            <el-icon><House /></el-icon>
            <span>工作台</span>
@@ -64,9 +63,13 @@
            <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>
@@ -90,14 +93,11 @@
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) {
@@ -105,7 +105,9 @@
      router.push('/profile')
      break
    case 'logout':
      localStorage.removeItem('token')
      // 清除所有认证数据
      clearAuth()
      // 跳转到登录页面
      router.push('/login')
      break
  }