From 211a112e8188d442909d5b922a07a1efd2124916 Mon Sep 17 00:00:00 2001 From: xingyu4j Date: Wed, 7 Dec 2022 17:50:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=94=A8=E6=88=B7=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=A4=B4=E5=83=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yudao-ui-admin-vue3/src/views/Home/Index.vue | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/yudao-ui-admin-vue3/src/views/Home/Index.vue b/yudao-ui-admin-vue3/src/views/Home/Index.vue index 3966bad66..07ab61be3 100644 --- a/yudao-ui-admin-vue3/src/views/Home/Index.vue +++ b/yudao-ui-admin-vue3/src/views/Home/Index.vue @@ -167,20 +167,21 @@ import { EChartsOption } from 'echarts' import { ElRow, ElCol, ElSkeleton, ElCard, ElDivider, ElLink } from 'element-plus' import { formatTime } from '@/utils' import { useI18n } from '@/hooks/web/useI18n' -import { CACHE_KEY, useCache } from '@/hooks/web/useCache' +import { useUserStore } from '@/store/modules/user' import { useWatermark } from '@/hooks/web/useWatermark' import { Echart } from '@/components/Echart' import { CountTo } from '@/components/CountTo' import { Highlight } from '@/components/Highlight' +import avatarImg from '@/assets/imgs/avatar.gif' import type { WorkplaceTotal, Project, Notice, Shortcut } from './types' import { pieOptions, barOptions } from './echarts-data' const { t } = useI18n() -const { wsCache } = useCache() +const userStore = useUserStore() const { setWatermark } = useWatermark() const loading = ref(true) -const avatar = wsCache.get(CACHE_KEY.USER).user.avatar -const username = wsCache.get(CACHE_KEY.USER).user.nickname +const avatar = userStore.getUser.avatar ? userStore.getUser.avatar : avatarImg +const username = userStore.getUser.nickname const pieOptionsData = reactive(pieOptions) as EChartsOption // 获取统计数 let totalSate = reactive({