From 178064f42ca431b61a92922e8228cc2499f72e0c Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Sat, 12 Jul 2025 11:27:42 +0800 Subject: [PATCH] refactor: improve workspace ID handling by adding check for current workspace permissions --- ui/src/stores/modules/user.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ui/src/stores/modules/user.ts b/ui/src/stores/modules/user.ts index b1bd0f81..03e6acbd 100644 --- a/ui/src/stores/modules/user.ts +++ b/ui/src/stores/modules/user.ts @@ -103,6 +103,9 @@ const useUserStore = defineStore('user', { }) .filter((id) => id !== null); // 过滤掉无效的ID if (workspaceManagePermissions && workspaceManagePermissions.length > 0) { + if (workspaceManagePermissions.includes(localStorage.getItem('workspace_id') || 'default')) { + return + } this.setWorkspaceId(workspaceManagePermissions[0]) } },