From 6e11b2fcac5dd50f76e0a4e7b82502ead6d15feb Mon Sep 17 00:00:00 2001 From: huanghao1412 Date: Mon, 18 Mar 2024 12:47:32 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=B5=8C=E5=85=A5?= =?UTF-8?q?=E5=B7=A5=E7=A8=8B=E7=BB=84=E6=80=81=E5=9B=BA=E5=AE=9A=E8=B4=A6?= =?UTF-8?q?=E5=8F=B7=E5=AF=BC=E8=87=B4=E7=88=B6=E7=BA=A7=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E6=B7=B7=E4=B9=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CustomComponents/EngineeringConfig/index.vue | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/packages/components/CustomComponents/CustomComponents/EngineeringConfig/index.vue b/src/packages/components/CustomComponents/CustomComponents/EngineeringConfig/index.vue index c430ab71..1b6bd69c 100644 --- a/src/packages/components/CustomComponents/CustomComponents/EngineeringConfig/index.vue +++ b/src/packages/components/CustomComponents/CustomComponents/EngineeringConfig/index.vue @@ -14,6 +14,7 @@ import { computed, PropType, toRefs, onMounted, onUnmounted, ref, watch, defineE import { CreateComponentType } from '@/packages/index.d' import { useOriginStore } from '@/store/modules/originStore/originStore' import { postMessageToParent, isPreview } from '@/utils' +import { useRouterStore } from '@/store/modules/routerStore/routerStore' const props = defineProps({ chartConfig: { @@ -26,12 +27,14 @@ const { w, h } = toRefs(props.chartConfig.attr) const originStore = useOriginStore() +const routerStore = useRouterStore() let url = computed(() => { // const account = originStore?.getOriginStore?.user?.user?.account const account = 'admin' const password = 'laimi@123' - let origin = process.env.NODE_ENV === 'production' ? window.location.origin : 'http://192.168.0.42:9528' - let str = `${origin}/static/#/dynamicRing/schematicDiagram/${props.chartConfig.customData.mapId}?parentOrigin=${window.location.origin}&isScreenIframe=true&account=${account}&password=${password}` + let origin = process.env.NODE_ENV === 'production' ? window.location.origin : 'http://192.168.0.55:9528' + // let str = `${origin}/static/#/dynamicRing/schematicDiagram/${props.chartConfig.customData.mapId}?parentOrigin=${window.location.origin}&isScreenIframe=true&account=${account}&password=${password}` + let str = `${origin}/static/#/dynamicRing/schematicDiagram/${props.chartConfig.customData.mapId}?parentOrigin=${window.location.origin}&isScreenIframe=true&access_token=${routerStore.token}` return str }) @@ -43,7 +46,7 @@ const option = computed(() => { const emit = defineEmits(['changeZIndex', 'enableOuter']) const handleMsg = (event: any) => { - let origin = process.env.NODE_ENV === 'production' ? window.location.origin : 'http://192.168.0.42:9528' + let origin = process.env.NODE_ENV === 'production' ? window.location.origin : 'http://192.168.0.55:9528' if (event.origin === origin) { // 处理来自子级页面的消息 let obj = event.data @@ -113,7 +116,7 @@ watch(() => setIframeStr, () => { const postMsgToChild = (obj: Object) => { if(iframe.value) { - let origin = process.env.NODE_ENV === 'production' ? window.location.origin : 'http://192.168.0.42:9528' + let origin = process.env.NODE_ENV === 'production' ? window.location.origin : 'http://192.168.0.55:9528' iframe.value.contentWindow.postMessage(obj, origin); } }