lrj
1 天以前 f04f35b562760afbac0c477357e2a29f77aec3b9
web/src/layout/index.vue
@@ -90,14 +90,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 +102,9 @@
      router.push('/profile')
      break
    case 'logout':
      localStorage.removeItem('token')
      // 清除所有认证数据
      clearAuth()
      // 跳转到登录页面
      router.push('/login')
      break
  }