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