diff --git a/ui/src/layout/layout-header/workspace-dropdown/index.vue b/ui/src/layout/layout-header/workspace-dropdown/index.vue
index 126c389d7..c928615f2 100644
--- a/ui/src/layout/layout-header/workspace-dropdown/index.vue
+++ b/ui/src/layout/layout-header/workspace-dropdown/index.vue
@@ -55,7 +55,7 @@ async function getWorkspaceList() {
onBeforeMount(async () => {
await getWorkspaceList()
- const id = user.getWorkspaceId() ?? 'default'
+ const id = localStorage.getItem('workspace_id') ?? 'default'
currentWorkspace.value = workspaceList.value.find((item) => item.id === id)
})
diff --git a/ui/src/stores/modules/user.ts b/ui/src/stores/modules/user.ts
index 4df662ced..31341bdc1 100644
--- a/ui/src/stores/modules/user.ts
+++ b/ui/src/stores/modules/user.ts
@@ -32,7 +32,7 @@ const useUserStore = defineStore('user', {
license_is_valid: false,
edition: 'CE',
themeInfo: null,
- workspace_id: 'default',
+ workspace_id: '',
}),
actions: {
getLanguage() {
@@ -53,14 +53,8 @@ const useUserStore = defineStore('user', {
localStorage.setItem('workspace_id', workspace_id)
},
getWorkspaceId(): string | null {
- if (this.workspace_id) {
- return this.workspace_id
- }
- const workspace_id = localStorage.getItem('workspace_id')
- if (workspace_id) {
- this.workspace_id = workspace_id
- }
- return workspace_id
+ this.workspace_id = this.workspace_id || localStorage.getItem('workspace_id') || 'default'
+ return this.workspace_id
},
getPermissions() {
diff --git a/ui/src/views/document/component/SelectKnowledgeDialog.vue b/ui/src/views/document/component/SelectKnowledgeDialog.vue
index 83ffeeb4d..eeb813140 100644
--- a/ui/src/views/document/component/SelectKnowledgeDialog.vue
+++ b/ui/src/views/document/component/SelectKnowledgeDialog.vue
@@ -8,36 +8,14 @@
:close-on-press-escape="false"
>
- {{ $t('views.chatLog.selectKnowledge') }}
- {{ $t('views.chatLog.selectKnowledge') }}
-