import{x as t,u as s,y as e,z as a,j as i,A as l,B as n,p as r,c as o,w as u,i as d,o as c,b as h,C as g}from"./index-Cp2JAVBI.js";import{_ as p}from"./_plugin-vue_export-helper.BCo6x5W8.js";const T=p({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 c(),o(r,null,{default:u((()=>[h(n,{src:i.url},null,8,["src"])])),_:1})}]]);export{T as default};