From f64693c0da5483d8670220bf3a5bf89a32e94a20 Mon Sep 17 00:00:00 2001
From: peng <peng.com>
Date: 星期五, 07 十一月 2025 10:34:21 +0800
Subject: [PATCH] 解决线上打包问题
---
web/src/layout/index.vue | 18 ++++++++++--------
1 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/web/src/layout/index.vue b/web/src/layout/index.vue
index 406c232..068ac33 100644
--- a/web/src/layout/index.vue
+++ b/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
}
--
Gitblit v1.8.0