diff --git a/src/api/system/user/types.ts b/src/api/system/user/types.ts index a6b97d5e..c060d870 100644 --- a/src/api/system/user/types.ts +++ b/src/api/system/user/types.ts @@ -36,7 +36,8 @@ export interface UserVO extends BaseEntity { email: string; phoneNumber: string; gender: string; - avatar: string; + avatar?: string | number; + avatarUrl?: string; status: string; delFlag: string; loginIp: string; @@ -67,6 +68,7 @@ export interface UserForm { gender?: string; status: string; remark?: string; + avatar?: string | number; postIds: string[]; roleIds: string[]; } diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 3167a7c4..060a14be 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -45,7 +45,7 @@ export const useUserStore = defineStore('user', () => { return Promise.reject(err); } const user = data.user; - const profile = user.avatar == '' || user.avatar == null ? defAva : user.avatar; + const profile = user.avatarUrl == '' || user.avatarUrl == null ? defAva : user.avatarUrl; if (data.roles && data.roles.length > 0) { // 验证返回的roles是否是一个非空数组