修正头像无法显示的问题

This commit is contained in:
dataprince 2024-01-29 20:21:05 +08:00
parent 70fb2294d0
commit 52c423f6b7
2 changed files with 2 additions and 1 deletions

View File

@ -34,6 +34,7 @@ export interface UserVO extends BaseEntity {
phonenumber: string; phonenumber: string;
gender: string; gender: string;
avatar: string; avatar: string;
url: string;
status: string; status: string;
delFlag: string; delFlag: string;
loginIp: string; loginIp: string;

View File

@ -36,7 +36,7 @@ export const useUserStore = defineStore('user', () => {
if (res) { if (res) {
const data = res.data; const data = res.data;
const user = data.user; const user = data.user;
const profile = user.avatar == '' || user.avatar == null ? defAva : user.avatar; const profile = user.url == '' || user.url == null ? defAva : user.url;
if (data.roles && data.roles.length > 0) { if (data.roles && data.roles.length > 0) {
// 验证返回的roles是否是一个非空数组 // 验证返回的roles是否是一个非空数组