From a277069644fd1bee5e187211eeb007ca68795e7c Mon Sep 17 00:00:00 2001 From: "xinxin.wu" Date: Fri, 6 Nov 2026 18:17:38 +0800 Subject: [PATCH] fix: system workspace loading --- ui/src/views/system/identity/workspaces/index.vue | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/ui/src/views/system/identity/workspaces/index.vue b/ui/src/views/system/identity/workspaces/index.vue index f33accbf2da..33777c4f75e 100644 --- a/ui/src/views/system/identity/workspaces/index.vue +++ b/ui/src/views/system/identity/workspaces/index.vue @@ -49,12 +49,15 @@ function handleWorkspaceDelete(workspace: WorkspaceItem) { .then(() => MsgConfirm(`确认删除${workspace.name}?`, '删除后,该空间下的成员都会被移除,请谨慎操作。').then(() => { workspaceLoading.value = true - return WorkspaceApi.deleteWorkspace(workspace.id as string).then(() => { - MsgSuccess('删除成功') - if (currentWorkspace.value?.id === workspace.id) { - return loadWorkspaceOptions() - } - }) + return WorkspaceApi.deleteWorkspace(workspace.id as string) + .then(() => { + MsgSuccess('删除成功') + // 删除未选中的空间也要刷新列表,并保留当前选中项。 + return loadWorkspaceOptions(currentWorkspace.value?.id) + }) + .finally(() => { + workspaceLoading.value = false + }) }), )