From 7ba080d35812e6db7bd5aa8f88161c02653eb6c1 Mon Sep 17 00:00:00 2001 From: lrj <owen.stl@gmail.com> Date: 星期三, 24 九月 2025 22:42:35 +0800 Subject: [PATCH] feat: 优化员工和评委编辑功能的密码重置逻辑 --- web/src/layout/index.vue | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/web/src/layout/index.vue b/web/src/layout/index.vue index 03aaa51..75d787e 100644 --- a/web/src/layout/index.vue +++ b/web/src/layout/index.vue @@ -33,7 +33,8 @@ <el-dropdown @command="handleCommand"> <span class="user-info"> <el-icon><User /></el-icon> - <span>绠$悊鍛�</span> + <span>{{ currentUserName }}</span> + <el-tag size="small" style="margin-left: 8px">{{ currentUserRole }}</el-tag> <el-icon><ArrowDown /></el-icon> </span> <template #dropdown> @@ -58,9 +59,14 @@ import { computed } from 'vue' import { useRoute, useRouter } from 'vue-router' import { ElMessage, ElMessageBox } from 'element-plus' +import { getCurrentUserDisplayName, getCurrentUserRoleText, clearAuth } from '@/utils/auth' const route = useRoute() const router = useRouter() + +// 褰撳墠鐢ㄦ埛淇℃伅 +const currentUserName = computed(() => getCurrentUserDisplayName()) +const currentUserRole = computed(() => getCurrentUserRoleText()) // 鑿滃崟椤� const menuItems = [ @@ -90,7 +96,7 @@ type: 'warning' }) - localStorage.removeItem('token') + clearAuth() ElMessage.success('閫�鍑虹櫥褰曟垚鍔�') router.push('/login') } catch { -- Gitblit v1.8.0