fix: 修改头像预览问题
Build and Deploy Vue3 / build (push) Successful in 1m25s
Build and Deploy Vue3 / deploy (push) Successful in 1m18s

This commit is contained in:
2026-04-20 16:04:47 +08:00
parent d72a4f804e
commit 64d40cbbbf
+15 -5
View File
@@ -1149,11 +1149,21 @@ const handleAvatarModify = async (row) => {
avatarForm.user_id = row.UserId avatarForm.user_id = row.UserId
avatarForm.cover_id = row.CoverID || '' avatarForm.cover_id = row.CoverID || ''
currentEditUser.value = row currentEditUser.value = row
currentAvatarUrl.value = ''
// 直接使用 row.avatarUrl(来自 user.cover)渲染当前头像
// row.avatarUrl 已经在 fetchUserList 中从 user.cover 映射过来 if (row.avatarUrl) {
currentAvatarUrl.value = row.avatarUrl || '' currentAvatarUrl.value = row.avatarUrl
} else if (row.CoverID) {
try {
const res = await getFileDetail({ file_id: row.CoverID })
if (res.data.code === 200 && res.data.data?.url) {
currentAvatarUrl.value = res.data.data.url
}
} catch (error) {
console.error('获取头像失败:', error)
}
}
avatarDialogVisible.value = true avatarDialogVisible.value = true
} }