From 60b1ae41c10240c8104965bea29b485e9725a2b6 Mon Sep 17 00:00:00 2001 From: shil <452061493@qq.com> Date: Wed, 14 Oct 2026 10:37:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BA=E4=BA=86=20ifram=20=E5=90=8C=E6=84=8F?= =?UTF-8?q?ip?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../layout/components/IframeToggle/index.vue | 7 +++-- .../src/layout/components/Sidebar/Link.vue | 5 ++-- .../src/store/modules/permission.ts | 9 +++---- .../zdxt-admin-plus-ui/src/utils/validate.ts | 26 +++++++++++++++++++ 4 files changed, 37 insertions(+), 10 deletions(-) diff --git a/zdxt-web-client/zdxt-admin-plus-ui/src/layout/components/IframeToggle/index.vue b/zdxt-web-client/zdxt-admin-plus-ui/src/layout/components/IframeToggle/index.vue index 62a834bb..a2b985b0 100644 --- a/zdxt-web-client/zdxt-admin-plus-ui/src/layout/components/IframeToggle/index.vue +++ b/zdxt-web-client/zdxt-admin-plus-ui/src/layout/components/IframeToggle/index.vue @@ -12,17 +12,20 @@ import InnerLink from '../InnerLink/index.vue'; import { useTagsViewStore } from '@/store/modules/tagsView'; +import { resolveSameOriginUrl } from '@/utils/validate'; const route = useRoute(); const tagsViewStore = useTagsViewStore(); function iframeUrl(url: string | undefined, query: any) { + // 菜单 iframe 链接跟当前访问端口走,避免写死 80 导致 12004 被 X-Frame-Options 拦截 + const base = resolveSameOriginUrl(url); if (Object.keys(query).length > 0) { const params = Object.keys(query) .map((key) => key + '=' + query[key]) .join('&'); - return url + '?' + params; + return base + '?' + params; } - return url; + return base; } diff --git a/zdxt-web-client/zdxt-admin-plus-ui/src/layout/components/Sidebar/Link.vue b/zdxt-web-client/zdxt-admin-plus-ui/src/layout/components/Sidebar/Link.vue index fd75f357..185abadc 100644 --- a/zdxt-web-client/zdxt-admin-plus-ui/src/layout/components/Sidebar/Link.vue +++ b/zdxt-web-client/zdxt-admin-plus-ui/src/layout/components/Sidebar/Link.vue @@ -5,7 +5,7 @@