新增:新增获取用户信息 API,未设置头像时,前端将根据用户性别显示对应默认头像

This commit is contained in:
2023-01-02 10:23:19 +08:00
parent 21f5aceccf
commit 88755ab720
26 changed files with 325 additions and 563 deletions

View File

@@ -144,7 +144,7 @@
:size="32"
:style="{ marginRight: '8px', cursor: 'pointer' }"
>
<img alt="avatar" :src="avatar" />
<img alt="avatar" :src="loginStore.avatar ?? getAvatar(loginStore.gender)" />
</a-avatar>
<template #content>
<a-doption>
@@ -194,6 +194,7 @@
import { LOCALE_OPTIONS } from '@/locale';
import useLocale from '@/hooks/locale';
import useUser from '@/hooks/user';
import getAvatar from "@/utils/avatar";
import MessageBox from '../message-box/index.vue';
const appStore = useAppStore();
@@ -202,9 +203,6 @@
const { changeLocale } = useLocale();
const { isFullscreen, toggle: toggleFullScreen } = useFullscreen();
const locales = [...LOCALE_OPTIONS];
const avatar = computed(() => {
return loginStore.avatar;
});
const theme = computed(() => {
return appStore.theme;
});
@@ -267,6 +265,11 @@
display: flex;
align-items: center;
padding-left: 20px;
img {
width: 32px;
height: 32px;
}
}
.right-side {