From 114c2985c09cce72757e16c5273b8d97d41e7fc8 Mon Sep 17 00:00:00 2001 From: CaptainB Date: Mon, 7 Jul 2025 17:04:14 +0800 Subject: [PATCH] fix: improve workspace ID assignment and use const for lastIndex MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1057324 --user=刘瑞斌 【资源授权】企业版-进入资源授权页面显示工作空间-默认应该显示用户所在的工作空间 https://www.tapd.cn/62980211/s/1724719 --- ui/src/views/system/resource-authorization/index.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/src/views/system/resource-authorization/index.vue b/ui/src/views/system/resource-authorization/index.vue index ea2e7bd0c..b9a031dd6 100644 --- a/ui/src/views/system/resource-authorization/index.vue +++ b/ui/src/views/system/resource-authorization/index.vue @@ -199,7 +199,7 @@ const settingTags = reactive([ // 当前激活的数据类型(应用/知识库/模型/工具) const activeData = computed(() => { - var lastIndex = route.path.lastIndexOf('/') + const lastIndex = route.path.lastIndexOf('/') const currentPathType = route.path.substring(lastIndex + 1).toUpperCase() return settingTags.filter((item) => { return item.type === currentPathType @@ -430,7 +430,7 @@ const currentWorkspace = computed(() => { async function getWorkspaceList() { const res = await loadPermissionApi('workspace').getSystemWorkspaceList(loading) workspaceList.value = res.data - currentWorkspaceId.value = 'default' + currentWorkspaceId.value = user.getWorkspaceId() as string || 'default' } function changeWorkspace(item: WorkspaceItem) {