diff --git a/ui/src/views/system/identity/groups/index.vue b/ui/src/views/system/identity/groups/index.vue index 81e00126b5e..f9ffa1b23c8 100644 --- a/ui/src/views/system/identity/groups/index.vue +++ b/ui/src/views/system/identity/groups/index.vue @@ -12,10 +12,10 @@ import { useStore } from '@/stores' import perm from '@/permission/index.ts' import { LOGIN_METHOD } from '@/api/enums' import { LOGIN_METHOD_LABELS } from '@/constants' -const { auth } = useStore() +const { auth, user } = useStore() /* 选择工作空间列表 */ -const selectedWorkspaceId = ref('default') +const selectedWorkspaceId = ref(user.userInfo?.workspace_list?.[0]?.id ?? 'default') const workspaceOptions = ref([]) const loadingView = ref(false) diff --git a/ui/src/views/system/identity/resource-authorization/index.vue b/ui/src/views/system/identity/resource-authorization/index.vue index ebdcd26ed54..5ce215b835d 100644 --- a/ui/src/views/system/identity/resource-authorization/index.vue +++ b/ui/src/views/system/identity/resource-authorization/index.vue @@ -24,7 +24,7 @@ import UserAuthorizationList from './components/UserAuthorizationList.vue' import UserGroupAuthorizationList from './components/user-group/UserGroupAuthorizationList.vue' import { RESOURCE_AUTHORIZATION_LABELS } from './constants' -const { auth } = useStore() +const { auth, user } = useStore() const route = useRoute() const resourceType = ref((route.meta.resource as ResourceAuthorizationType) ?? RESOURCE_TYPE.APPLICATION) @@ -40,7 +40,7 @@ const resourceTypeOptions: OptionItem[] = [ /* 选择工作空间列表 */ const loadingView = ref(false) -const selectedWorkspaceId = ref('default') +const selectedWorkspaceId = ref(user.userInfo?.workspace_list?.[0]?.id ?? 'default') const workspaceOptions = ref([]) function handleWorkspaceSelect(workspace: WorkspaceItem) {