import{g as t,u as s,v as e,x as a,h as i,y as l,z as n,m as r,c as o,w as u,i as d,o as h,b as c,A as g}from"./index-4T3E6rDi.js";import{_ as m}from"./_plugin-vue_export-helper.BCo6x5W8.js";const p=m({data:()=>({show:!1,url:"",ticket:"",ssoTimer:null,tenantUserInfo:[]}),onLoad(s){this.url=t("ssoUrl"),this.ticket=s.ssoTicket,this.ssoTimer=setInterval((()=>{this.getTicketStatus()}),1e3)},onUnload(){this.clearTimer()},methods:{getTicketStatus(){const t=s();this.ticket&&e(this.ticket).then((s=>{if(2!=s.data.status)if(this.clearTimer(),1==s.data.status)a({title:"登录中"}),t.setToken(s.data.value),t.getCurrentUser().then((t=>{i(),l({url:"/pages/index/index"})})).catch((()=>{i(),l({url:"/pages/login/index"})}));else if(4==s.data.status)n("ssoTicket",this.ticket),l({url:"/pages/login/index"});else if(6==s.data.status){let e=JSON.parse(s.data.value);1==e.length?(a({title:"登录中"}),t.setToken(s.data.value),t.getCurrentUser().then((t=>{i(),l({url:"/pages/index/index"})})).catch((()=>{i(),l({url:"/pages/login/index"})}))):l({url:"/pages/login/index?data="+JSON.stringify(e)})}else 7==s.data.status?(this.$u.toast("第三方账号未绑定账号,请绑定后重试"),setTimeout((()=>{l({url:"/pages/login/index"})}),600)):(this.show=!1,this.ssoUrl="",r({title:s.data.value||"操作超时,请重新点击登录",icon:"none"}),l({url:"/pages/login/index"}))}))},clearTimer(){this.ssoTimer&&(clearInterval(this.ssoTimer),this.ssoTimer=null)}}},[["render",function(t,s,e,a,i,l){const n=g,r=d;return h(),o(r,null,{default:u((()=>[c(n,{src:i.url},null,8,["src"])])),_:1})}]]);export{p as default};