2 lines
1023 B
JavaScript
2 lines
1023 B
JavaScript
|
import{d as _,r as y,b as p,n as w,w as h,e as k,o as v,c as b,a as x,v as I,g as T,f as E,l as B,s as C,E as n}from"./index-ce293e15.js";const q={class:"social-callback"},R=_({__name:"index",setup(S){const t=x(),s=y(!0),r=t.query.code,l=t.query.state,i=t.query.source,d=localStorage.getItem("tenantId")?localStorage.getItem("tenantId"):"000000",o=async e=>{if(e.code!==200)throw new Error(e.msg);e.data!==null&&C(e.data.access_token),n.success(e.msg),setTimeout(()=>{location.href="/manage/index"},2e3)},c=e=>{n.error(e.message),setTimeout(()=>{location.href="/manage/index"},2e3)},u=async e=>{try{const a=await E(e);await o(a),s.value=!1}catch(a){c(a)}},g=async e=>{console.log(2);try{const a=await B(e);await o(a),s.value=!1}catch(a){c(a)}},f=async()=>{const e={socialCode:r,socialState:l,tenantId:d,source:i,clientId:"e5cd7e4891bf95d1d19206ce24a7b32e",grantType:"social"};T()?await u(e):await g(e)};return p(()=>{w(()=>{f()})}),(e,a)=>{const m=I;return h((v(),b("div",q,null,512)),[[m,k(s)]])}}});export{R as default};
|