From aa95d0e87cf2a7e9b05219329bed17c8c6899430 Mon Sep 17 00:00:00 2001 From: puhui999 Date: Sun, 28 Dec 2025 18:55:07 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E3=80=90ele/antd=E3=80=91profile?= =?UTF-8?q?=20todo=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/_core/profile/modules/user-social.vue | 2 +- .../views/_core/profile/modules/base-info.vue | 7 +++++-- .../_core/profile/modules/profile-user.vue | 17 ++++++++++------- .../views/_core/profile/modules/user-social.vue | 9 ++++----- 4 files changed, 20 insertions(+), 15 deletions(-) diff --git a/apps/web-antd/src/views/_core/profile/modules/user-social.vue b/apps/web-antd/src/views/_core/profile/modules/user-social.vue index 8a34b1779..ddb806567 100644 --- a/apps/web-antd/src/views/_core/profile/modules/user-social.vue +++ b/apps/web-antd/src/views/_core/profile/modules/user-social.vue @@ -100,7 +100,7 @@ const [Grid, gridApi] = useVbenVxeGrid({ toolbarConfig: { enabled: false, }, - } as VxeTableGridOptions, + }, }); /** 解绑账号 */ diff --git a/apps/web-ele/src/views/_core/profile/modules/base-info.vue b/apps/web-ele/src/views/_core/profile/modules/base-info.vue index c97d12646..39b5b4856 100644 --- a/apps/web-ele/src/views/_core/profile/modules/base-info.vue +++ b/apps/web-ele/src/views/_core/profile/modules/base-info.vue @@ -21,10 +21,13 @@ const emit = defineEmits<{ (e: 'success'): void; }>(); -// TODO @puhui999:展示貌似不太对;应该是左右,不是上下哈 const [Form, formApi] = useVbenForm({ commonConfig: { - labelWidth: 70, + componentProps: { + class: 'w-full', + }, + formItemClass: 'col-span-2', + labelWidth: 80, }, schema: [ { diff --git a/apps/web-ele/src/views/_core/profile/modules/profile-user.vue b/apps/web-ele/src/views/_core/profile/modules/profile-user.vue index 675bb131c..fbf7c6fc4 100644 --- a/apps/web-ele/src/views/_core/profile/modules/profile-user.vue +++ b/apps/web-ele/src/views/_core/profile/modules/profile-user.vue @@ -25,7 +25,6 @@ const avatar = computed( () => props.profile?.avatar || preferences.app.defaultAvatar, ); -// TODO @puhui999:头像上传没跑通 async function handelUpload({ file, filename, @@ -37,9 +36,9 @@ async function handelUpload({ const { httpRequest } = useUpload(); // 将 Blob 转换为 File const fileObj = new File([file], filename, { type: file.type }); - const avatar = await httpRequest(fileObj); - // 2. 更新用户头像 - await updateUserProfile({ avatar }); + const res = await httpRequest(fileObj); + // 2. 更新用户头像(httpRequest 返回 { url: string }) + await updateUserProfile({ avatar: res.url }); } @@ -57,8 +56,8 @@ async function handelUpload({
- - + + - {{ profile.posts.map((post) => post.name).join(',') }} + {{ + profile.posts && profile.posts.length > 0 + ? profile.posts.map((post) => post.name).join(',') + : '-' + }}