import{_ as l,d as q,r as c,e as v,S as i,I as n,J as $,X as f,c as g,u as h,D as _,o as I,Y as m}from"./index.8d733f79.js";import{g as w}from"./base64.f6a4f591.js";const S=""+new URL("jumpLoading.3c953b58.png",import.meta.url).href;const x={style:{height:"100%",background:"white",display:"flex"}},B=m('<div style="margin:auto;text-align:center;" data-v-5008696d><img src="'+S+'" width="135px" class="bounce-up" data-v-5008696d><div style="margin-bottom:100px;" data-v-5008696d><div class="circle_jump" data-v-5008696d></div></div><div style="color:#696969;margin-bottom:100px;font-size:24px;" data-v-5008696d>\u6B63\u5728\u8DF3\u8F6C...</div></div>',1),C=[B],D={__name:"autoLogin",setup(M){const d=q(),s=h(),{proxy:e}=_(),u=c({username:"",password:""}),a=c(!1);v(()=>{if(e.$route.query.templateCode)p();else{if(!e.$route.query.ticket){i.error("\u767B\u5F55\u4FE1\u606F\u89E3\u6790\u51FA\u9519");return}const o=w.decode(e.$route.query.ticket);try{u.value=JSON.parse(o)||{}}catch{i.error("\u767B\u5F55\u4FE1\u606F\u89E3\u6790\u51FA\u9519");return}if(!u.value.appid||!u.value.password){i.error("\u767B\u5F55\u4FE1\u606F\u89E3\u6790\u51FA\u9519");return}y()}});function y(){a.value=!0;const o={username:u.value.appid,password:u.value.password};o.username=o.username.trim(),o.password=o.password.replaceAll("+","%2B"),d.login(o).then(()=>{n().delAllVisitedViews(),$.session.set("password",o.password);const r={};e.$route.query.isvDeviceId&&(r.isvDeviceId=e.$route.query.isvDeviceId),e.$route.query.isMenu&&(r.isMenu=e.$route.query.isMenu),e.$route.query.deviceCode&&(r.deviceCode=e.$route.query.deviceCode),e.$route.query.isShowBoard&&(r.isShowBoard=e.$route.query.isShowBoard),e.$route.query.factoryId&&(r.factoryId=e.$route.query.factoryId),e.$route.query.orgId&&(r.orgId=e.$route.query.orgId),e.$route.query.deviceId&&(r.deviceId=e.$route.query.deviceId),e.$route.query.hideTree&&(r.hideTree=e.$route.query.hideTree),e.$route.query.id&&(r.id=e.$route.query.id),s.push({path:e.$route.query.page?`/${e.$route.query.page}`:"/",query:r})}).catch(()=>{a.value=!1})}const p=()=>{const o={param:{token:e.$route.query.token,templateCode:e.$route.query.templateCode,factoryId:e.$route.query.factoryId}};f(o).then(r=>{d.setLoginInfo(r.data),n().delAllVisitedViews();const t={};e.$route.query.isvDeviceId&&(t.isvDeviceId=e.$route.query.isvDeviceId),e.$route.query.isMenu&&(t.isMenu=e.$route.query.isMenu),e.$route.query.deviceCode&&(t.deviceCode=e.$route.query.deviceCode),e.$route.query.isShowBoard&&(t.isShowBoard=e.$route.query.isShowBoard),e.$route.query.factoryId&&(t.factoryId=e.$route.query.factoryId),e.$route.query.orgId&&(t.orgId=e.$route.query.orgId),e.$route.query.deviceId&&(t.deviceId=e.$route.query.deviceId),e.$route.query.hideTree&&(t.hideTree=e.$route.query.hideTree),e.$route.query.id&&(t.id=e.$route.query.id),s.push({path:e.$route.query.page?`/${e.$route.query.page}`:"/",query:t})}).catch(()=>{i.error("\u767B\u5F55\u5931\u8D25")})};return(o,r)=>(I(),g("div",x,C))}},T=l(D,[["__scopeId","data-v-5008696d"]]);export{T as default};
