修复没有设置头像的显示异常
This commit is contained in:
@@ -3,6 +3,8 @@ import { UserInfosStates } from './interface';
|
|||||||
import { Session } from '/@/utils/storage';
|
import { Session } from '/@/utils/storage';
|
||||||
import { request } from '../utils/service';
|
import { request } from '../utils/service';
|
||||||
import { getBaseURL } from '../utils/baseUrl';
|
import { getBaseURL } from '../utils/baseUrl';
|
||||||
|
import headerImage from '/@/assets/img/headerImage.png';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户信息
|
* 用户信息
|
||||||
* @methods setUserInfos 设置用户信息
|
* @methods setUserInfos 设置用户信息
|
||||||
@@ -73,7 +75,7 @@ export const useUserInfo = defineStore('userInfo', {
|
|||||||
method: 'get',
|
method: 'get',
|
||||||
}).then((res:any)=>{
|
}).then((res:any)=>{
|
||||||
this.userInfos.username = res.data.name;
|
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.name = res.data.name;
|
||||||
this.userInfos.email = res.data.email;
|
this.userInfos.email = res.data.email;
|
||||||
this.userInfos.mobile = res.data.mobile;
|
this.userInfos.mobile = res.data.mobile;
|
||||||
|
|||||||
Reference in New Issue
Block a user