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 @@