diff --git a/src/views/group/index.vue b/src/views/group/index.vue index 3fdc4f610de2d5c3712bd6c8a5757d1bf2ad2ae0..8b7e563379cca829535bc9b708831fcfa767f17d 100644 --- a/src/views/group/index.vue +++ b/src/views/group/index.vue @@ -231,6 +231,7 @@ const handleSwitch = (switchType: string) => { switchIcon.value = switchType; }; const handleToGroup = async (row: any) => { + localStorage.setItem('teamId', row.teamId); await router.push({ path: `/groupInfo`, query: { name: row.teamName, id: row.teamId } }); let groupNav = navGroup.value; groupNav[1] = { @@ -242,7 +243,6 @@ const handleToGroup = async (row: any) => { } } setCurTeamInfo(row); - localStorage.setItem('teamId', row.teamId); } const handlequeryTeamList = (param: { teamType: string, page: number, pageSize: number, teamName?: string }) => { diff --git a/src/views/knowledgeLibrary/index.vue b/src/views/knowledgeLibrary/index.vue index a718ab5a96b0e52f388a204b24601b4cc8ed1106..2868ab4b1995957d34466caee8a94e10fb2d0061 100644 --- a/src/views/knowledgeLibrary/index.vue +++ b/src/views/knowledgeLibrary/index.vue @@ -846,7 +846,8 @@ const handleMultipleSelect = () => { const handleQueryKbLibrary = (params: QueryKbRequest) => { loading.value = true; - KbAppAPI.getKbLibrary({ teamId: route.query.id as string, ...params }) // 使用 computed 的 teamId + let teamId = route.query.id as string ?? localStorage.getItem('teamId'); + KbAppAPI.getKbLibrary({ teamId: teamId , ...params }) .then((res: any) => { fileTableList.data = res?.kbList; totalCount.value = res?.total;