You can not 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.6 KiB
2 lines
1.6 KiB
var p=(f,n,s)=>new Promise((l,o)=>{var i=e=>{try{r(s.next(e))}catch(t){o(t)}},d=e=>{try{r(s.throw(e))}catch(t){o(t)}},r=e=>e.done?l(e.value):Promise.resolve(e.value).then(i,d);r((s=s.apply(f,n)).next())});import{d as w,ea as F,cb as B,r as _,n as O,o as g,g as h,b as x,w as P,t as C,i as y,u as H,bo as b,Y as S,$ as m,aT as D}from"./index-f4658ae7.js";const T={class:"example"},I={key:0,class:"ant-tag-red"},R=w({__name:"SSO",setup(f){const n=F(window.location.href),s=B(),l=_(""),o=_(!0);if(n.ticket!=""&&n.ticket!="undefined"&&n.ticket!=null){const e=n.ticket.indexOf("#");l.value=n.ticket.substring(0,e)}const i=_(""),d=O(),r=e=>p(this,null,function*(){const t=e;if(t!=""&&t!="undefined"&&t!=null){const u=new m("BP.WF.HttpHandler.WF_SSO");u.AddPara("Ticket",t);let a=yield u.DoMethodReturnString("SSO_Callback");if(a.code==200){d.setToken(a.Token),S.success("\u767B\u5F55\u6210\u529F"),o.value=!0;const{origin:c,pathname:k}=window.location,v=c+k;window.location.replace(v)}else{const c=`\u767B\u5F55\u5931\u8D25\u6216ST\u65E0\u6548\uFF0C${a.msg}`;S.error(c),i.value=c}o.value=!1;return}try{let a=yield new m("BP.WF.HttpHandler.WF_SSO").DoMethodReturnString("SSO_Init");if(a.code==200){const c=`${a.SSOPath}login?service=${a.JumpSSOServicePath}`;window.location.href=c}else if(a.includes("info@")){s.push("/");return}}catch(u){S.error(u+",\u8BF7\u91CD\u65B0\u767B\u5F55")}});return n.ticket==null?r(""):r(l.value),(e,t)=>(g(),h("div",T,[x(H(b),{spinning:o.value,size:"large"},{default:P(()=>[i.value?(g(),h("div",I,C(i.value),1)):y("",!0)]),_:1},8,["spinning"])]))}});const M=D(R,[["__scopeId","data-v-1d929ff1"]]);export{M as default};
|