You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/p__Hami__index.2ea86a19.asy...

2 lines
1.2 KiB

"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[1344],{96046:function(y,c,n){n.r(c);var t=n(59301),o=n(76560),f=n(71418),g=n(49661);const E=({})=>{const s=(0,o.useLocation)(),h=(0,t.useRef)(null),[m,p]=(0,t.useState)(!0),[l,v]=(0,t.useState)(""),O="http://localhost:8080",r=(0,o.useSelector)(a=>{var i;return(i=a==null?void 0:a.globalSetting)==null?void 0:i.setting});(0,t.useEffect)(()=>{v(s.pathname+s.search)},[]),(0,t.useEffect)(()=>{const a=i=>{try{const e=JSON.parse(i.data);if(console.log(e,"messageData"),e.type==="ComponentLoaded"){p(!1);const d=window.location.pathname+window.location.search;d!==e.data&&u(d)}e.type==="ChangeThePath"&&o.history.push(e.data),e.type==="OpenThePath"&&(0,g.xg)(e.data),e.type==="BackThePath"&&o.history.back()}catch(e){}};return window.addEventListener("message",a),()=>{window.removeEventListener("message",a)}},[]),(0,t.useEffect)(()=>{l&&u(s.pathname+s.search)},[s.pathname]);const u=a=>{h.current.contentWindow.postMessage(JSON.stringify({type:"ChangeTheRoute",data:a}),"*")};return t.createElement(f.Z,{spinning:m},l&&t.createElement("iframe",{ref:h,style:{border:"none",display:"block",width:"100vw",height:"calc(100vh - 72px)"},src:`${r==null?void 0:r.hami_url}${l}`}))};c.default=E}}]);