feat: add cache key

This commit is contained in:
xingyu4j
2022-12-06 16:12:54 +08:00
parent c8c6e349ae
commit 3e60ff2970
18 changed files with 100 additions and 81 deletions

View File

@@ -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 { useCache } from '@/hooks/web/useCache'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import { useWatermark } from '@/hooks/web/useWatermark'
import { Echart } from '@/components/Echart'
import { CountTo } from '@/components/CountTo'
import { Highlight } from '@/components/Highlight'
import type { WorkplaceTotal, Project, Notice, Shortcut } from './types'
import { pieOptions, barOptions } from './echarts-data'
import { Icon } from 'vxe-table'
const { t } = useI18n()
const { wsCache } = useCache()
const { setWatermark } = useWatermark()
const loading = ref(true)
const avatar = wsCache.get('user').user.avatar
const username = wsCache.get('user').user.nickname
const avatar = wsCache.get(CACHE_KEY.USER).user.avatar
const username = wsCache.get(CACHE_KEY.USER).user.nickname
const pieOptionsData = reactive<EChartsOption>(pieOptions) as EChartsOption
// 获取统计数
let totalSate = reactive<WorkplaceTotal>({