You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
1.1 KiB
JavaScript

var m=(l,a,o)=>new Promise((c,t)=>{var r=e=>{try{s(o.next(e))}catch(n){t(n)}},u=e=>{try{s(o.throw(e))}catch(n){t(n)}},s=e=>e.done?c(e.value):Promise.resolve(e.value).then(r,u);s((o=o.apply(l,a)).next())});import{d as g,ap as _,o as y,_ as C,$ as L}from"./vue-aEZWZQSa.js";import{b as h,u as k,c as B,e as E,f as I,P as M,h as S}from"./entry/index-2-yrRtrk-1723018314898.js";import{u as T}from"./useLoading-DkMJ65Y_.js";import{a as q}from"./common-J5ceKo67.js";import"./antd-BY-1PcYE.js";const x="000000",A=g({__name:"index",setup(l){const a=_(),o=a.query.code,c=a.query.state,t=a.query.source,r=h("tenantId",x),u=k(),{createMessage:s}=S(),[e,n]=T({tip:"加载中..."}),{login:f}=B();return y(()=>m(this,null,function*(){try{if(e(),!q.find(p=>p.source===t&&p.action)){s.error({content:`未找到${t}平台`});return}const i={socialCode:o,socialState:c,tenantId:r.value,source:t,grantType:"social"};E()?(yield I(i),s.success(t+"授权成功")):(yield f(i),s.success(t+"登录成功"))}catch(d){}finally{n(),setTimeout(()=>{u(M.BASE_HOME)},2e3)}})),(d,i)=>(C(),L("div"))}});export{A as default};