diff --git a/frontend/src/hooks/useOpenNewPage.ts b/frontend/src/hooks/useOpenNewPage.ts index 40cef0e32a..f9a430293b 100644 --- a/frontend/src/hooks/useOpenNewPage.ts +++ b/frontend/src/hooks/useOpenNewPage.ts @@ -17,11 +17,14 @@ export default function useOpenNewPage() { // 如果传入参数指定了项目 id,则使用传入的项目 id delete query.pId; } + const orgId = query.orgId || appStore.currentOrgId; + if (orgId) { + // 如果传入参数指定了组织 id,则使用传入的组织 id + delete query.orgId; + } const queryParams = new URLSearchParams(query).toString(); window.open( - `${window.location.origin}#${router.resolve({ name }).fullPath}?orgId=${ - appStore.currentOrgId - }&pId=${pId}&${queryParams}`, + `${window.location.origin}#${router.resolve({ name }).fullPath}?orgId=${orgId}&pId=${pId}&${queryParams}`, '_blank' ); }