import{d as p,C as w,R as h,a as i,N as r,O as R,o as k,P as y,e as I,f as S}from"./vue.BxlDVA1H.js";import{u as _,y as C,z as E,S as n,A as T,H as x,D as B,I as D,N}from"./index.lP_uh0LI.js";const V=p({__name:"index",setup(b){const u=w(),c=h(),a=i(),o=i(""),d=_(),{themeConfig:l}=r(d),f=C(),{tagsViewRoutes:m}=r(f),g=(s,e)=>{if(typeof s!="string")return e;try{return JSON.parse(s)}catch(t){return console.error(t),e}},v=s=>{B().getSystemDictionarys(),s.name&&(m.value.find(e=>e.name===s.name)?u.push({name:s.name}):(D("该用户无权限访问"),N.done(),a.value.close()))};return R(()=>{a.value=E.service({lock:!0,text:"加载中",background:"rgba(0, 0, 0, 0.7)"})}),k(()=>{o.value=c.query.sessionId||"",o.value&&window.parent&&(n.set("sessionId",o.value),window.parent.postMessage({status:"ready",sessionId:o.value},"*")),window.addEventListener("message",async s=>{if(console.log("child window received the message:",s),o.value){let e={};const t=g(s.data);if(t?e={...t}:e={...s.data},console.log("received data:",e),e.sessionId&&e.sessionId===o.value)switch(e.status){case"init":n.set("hideSide",!!e.hideSide),e.token&&(n.set("token",e.token),l.value.isRequestRoutes?await x():await T(),v(e));break}}},!1)}),y(()=>{a.value.close()}),(s,e)=>(S(),I("div"))}});export{V as default};
