From 05f7d0b3b2814a44abc07c41148902ce62d5dedc Mon Sep 17 00:00:00 2001 From: pzzyf <2279948211@qq.com> Date: Wed, 4 Sep 2024 21:52:04 +0800 Subject: [PATCH 1/3] fix: external link jump --- .../layouts/src/widgets/global-search/search-panel.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/effects/layouts/src/widgets/global-search/search-panel.vue b/packages/effects/layouts/src/widgets/global-search/search-panel.vue index a381f49c39c..f9996968e06 100644 --- a/packages/effects/layouts/src/widgets/global-search/search-panel.vue +++ b/packages/effects/layouts/src/widgets/global-search/search-panel.vue @@ -99,7 +99,11 @@ async function handleEnter() { searchHistory.value.push(to); handleClose(); await nextTick(); - router.push(to.path); + if (to.path.startsWith('http://') || to.path.startsWith('https://')) { + window.location.href = to.path; + } else { + router.push({ path: to.path, replace: true }); + } } } From 79480540ca48e04622c12afd05ada8ad0693ffdb Mon Sep 17 00:00:00 2001 From: pzzyf <2279948211@qq.com> Date: Wed, 4 Sep 2024 22:58:48 +0800 Subject: [PATCH 2/3] fix: external link jump --- packages/effects/layouts/package.json | 1 + .../layouts/src/widgets/global-search/search-panel.vue | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/effects/layouts/package.json b/packages/effects/layouts/package.json index a074a359b70..7dbe025d1ef 100644 --- a/packages/effects/layouts/package.json +++ b/packages/effects/layouts/package.json @@ -24,6 +24,7 @@ "@vben-core/menu-ui": "workspace:*", "@vben-core/popup-ui": "workspace:*", "@vben-core/shadcn-ui": "workspace:*", + "@vben-core/shared": "workspace:*", "@vben-core/tabs-ui": "workspace:*", "@vben/constants": "workspace:*", "@vben/hooks": "workspace:*", diff --git a/packages/effects/layouts/src/widgets/global-search/search-panel.vue b/packages/effects/layouts/src/widgets/global-search/search-panel.vue index f9996968e06..56fe59598ac 100644 --- a/packages/effects/layouts/src/widgets/global-search/search-panel.vue +++ b/packages/effects/layouts/src/widgets/global-search/search-panel.vue @@ -8,6 +8,7 @@ import { SearchX, X } from '@vben/icons'; import { $t } from '@vben/locales'; import { mapTree, traverseTreeValues, uniqueByField } from '@vben/utils'; import { VbenIcon, VbenScrollbar } from '@vben-core/shadcn-ui'; +import { isHttpUrl } from '@vben-core/shared'; import { onKeyStroke, useLocalStorage, useThrottleFn } from '@vueuse/core'; @@ -99,8 +100,8 @@ async function handleEnter() { searchHistory.value.push(to); handleClose(); await nextTick(); - if (to.path.startsWith('http://') || to.path.startsWith('https://')) { - window.location.href = to.path; + if (isHttpUrl(to.path)) { + window.open(to.path, '_blank'); } else { router.push({ path: to.path, replace: true }); } From 19135aeeb8860ccee90d34970cf7fa2972bc1299 Mon Sep 17 00:00:00 2001 From: likui628 <90845831+likui628@users.noreply.github.com> Date: Thu, 5 Sep 2024 07:01:38 +0800 Subject: [PATCH 3/3] chore: update deps --- pnpm-lock.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0ac016507a9..31755e39401 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1002,6 +1002,9 @@ importers: '@vben-core/shadcn-ui': specifier: workspace:* version: link:../../@core/ui-kit/shadcn-ui + '@vben-core/shared': + specifier: workspace:* + version: link:../../@core/base/shared '@vben-core/tabs-ui': specifier: workspace:* version: link:../../@core/ui-kit/tabs-ui