From 73edafb95fd00591942c3da78ad1d410a995b510 Mon Sep 17 00:00:00 2001 From: lxy <10179281+lxy0722@user.noreply.gitee.com> Date: Tue, 7 Jan 2025 10:29:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B2=A1=E6=9C=89=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E5=A4=B4=E5=83=8F=E7=9A=84=E6=98=BE=E7=A4=BA=E5=BC=82?= =?UTF-8?q?=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/stores/userInfo.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web/src/stores/userInfo.ts b/web/src/stores/userInfo.ts index 13dbf2e..01aea20 100644 --- a/web/src/stores/userInfo.ts +++ b/web/src/stores/userInfo.ts @@ -3,6 +3,8 @@ import { UserInfosStates } from './interface'; import { Session } from '/@/utils/storage'; import { request } from '../utils/service'; import { getBaseURL } from '../utils/baseUrl'; +import headerImage from '/@/assets/img/headerImage.png'; + /** * 用户信息 * @methods setUserInfos 设置用户信息 @@ -73,7 +75,7 @@ export const useUserInfo = defineStore('userInfo', { method: 'get', }).then((res:any)=>{ this.userInfos.username = res.data.name; - this.userInfos.avatar = getBaseURL(res.data.avatar); + this.userInfos.avatar = (res.data.avatar && getBaseURL(res.data.avatar)) || headerImage; this.userInfos.name = res.data.name; this.userInfos.email = res.data.email; this.userInfos.mobile = res.data.mobile;