fix: 1050996

--bug=1050996 --user=王孝刚 【函数库】-编辑函数后,函数的创建者显示为空,刷新后恢复 https://www.tapd.cn/57709429/s/1651111
This commit is contained in:
wxg0103 2025-02-06 16:40:15 +08:00 committed by wxg
parent 5453aa7380
commit 20865d53c3

View File

@ -264,6 +264,11 @@ function getList() {
function refresh(data: any) {
if (data) {
const index = functionLibList.value.findIndex((v) => v.id === data.id)
if (user.userInfo && data.user_id === user.userInfo.id) {
data.username = user.userInfo.username
} else {
data.username = userOptions.value.find((v) => v.value === data.user_id)?.label
}
functionLibList.value.splice(index, 1, data)
} else {
paginationConfig.total = 0