import{b as W,i as N,c as q,w as F,a as G,_ as H,u as J,d as K}from"./base-xgxQQEpV.js";import{E as O}from"./el-card-CfK866jr.js";import{E as Q}from"./el-button-LKkD3jQh.js";import{A as R,h as T,j as p,o as l,k as i,l as f,B as w,c as V,C as a,n as d,D as X,t as m,g as o,i as Y,z as Z,p as C,s as b,u as ee,x as P}from"./vendor-vue-WbiK4TmU.js";import{_ as se}from"./style-CEbARg1o.js";import"./index-CoYtSGUZ.js";const r={primary:"icon-primary",success:"icon-success",warning:"icon-warning",error:"icon-error",info:"icon-info"},A={[r.primary]:N,[r.success]:G,[r.warning]:F,[r.error]:q,[r.info]:N},te=W({title:{type:String,default:""},subTitle:{type:String,default:""},icon:{type:String,values:["primary","success","warning","info","error"],default:"info"}}),oe=R({name:"ElResult"}),ne=R({...oe,props:te,setup($){const g=$,n=J("result"),c=T(()=>{const s=g.icon,u=s&&r[s]?r[s]:"icon-info",y=A[u]||A["icon-info"];return{class:u,component:y}});return(s,u)=>(l(),p("div",{class:d(a(n).b())},[i("div",{class:d(a(n).e("icon"))},[w(s.$slots,"icon",{},()=>[a(c).component?(l(),V(X(a(c).component),{key:0,class:d(a(c).class)},null,8,["class"])):f("v-if",!0)])],2),s.title||s.$slots.title?(l(),p("div",{key:0,class:d(a(n).e("title"))},[w(s.$slots,"title",{},()=>[i("p",null,m(s.title),1)])],2)):f("v-if",!0),s.subTitle||s.$slots["sub-title"]?(l(),p("div",{key:1,class:d(a(n).e("subtitle"))},[w(s.$slots,"sub-title",{},()=>[i("p",null,m(s.subTitle),1)])],2)):f("v-if",!0),s.$slots.extra?(l(),p("div",{key:2,class:d(a(n).e("extra"))},[w(s.$slots,"extra")],2)):f("v-if",!0)],2))}});var ae=H(ne,[["__file","result.vue"]]);const le=K(ae),re={class:"auth-wrap"},ie={class:"actions"},ce={key:0,class:"countdown app-muted"},ue={__name:"VerifyResultPage",setup($){const g=ee(),n=o(!1),c=o(""),s=o(""),u=o(""),y=o(""),h=o(""),I=o(""),k=o(""),_=o(0);let v=null;function L(){if(typeof window>"u")return null;const e=window.__APP_INITIAL_STATE__;return!e||typeof e!="object"?null:(window.__APP_INITIAL_STATE__=null,e)}function U(e){const t=!!e?.success;n.value=t,c.value=e?.title||(t?"验证成功":"验证失败"),s.value=e?.message||e?.error_message||(t?"操作已完成，现在可以继续使用系统。":"操作失败，请稍后重试。"),u.value=e?.primary_label||(t?"立即登录":"重新注册"),y.value=e?.primary_url||(t?"/login":"/register"),h.value=e?.secondary_label||(t?"":"返回登录"),I.value=e?.secondary_url||(t?"":"/login"),k.value=e?.redirect_url||(t?"/login":""),_.value=Number(e?.redirect_seconds||(t?5:0))||0}const z=T(()=>!!(h.value&&I.value)),B=T(()=>!!(k.value&&_.value>0));async function E(e){if(e){if(e.startsWith("http://")||e.startsWith("https://")){window.location.href=e;return}await g.push(e)}}function D(){B.value&&(v=window.setInterval(()=>{_.value-=1,_.value<=0&&(window.clearInterval(v),v=null,window.location.href=k.value)},1e3))}return Y(()=>{const e=L();U(e),D()}),Z(()=>{v&&window.clearInterval(v)}),(e,t)=>{const S=Q,M=le,j=O;return l(),p("div",re,[C(j,{shadow:"never",class:"auth-card","body-style":{padding:"22px"}},{default:b(()=>[t[2]||(t[2]=i("div",{class:"brand"},[i("div",{class:"brand-title"},"知识管理平台"),i("div",{class:"brand-sub app-muted"},"验证结果")],-1)),C(M,{icon:n.value?"success":"error",title:c.value,"sub-title":s.value,class:"result"},{extra:b(()=>[i("div",ie,[C(S,{type:"primary",onClick:t[0]||(t[0]=x=>E(y.value))},{default:b(()=>[P(m(u.value),1)]),_:1}),z.value?(l(),V(S,{key:0,onClick:t[1]||(t[1]=x=>E(I.value))},{default:b(()=>[P(m(h.value),1)]),_:1})):f("",!0)]),B.value?(l(),p("div",ce,m(_.value)+" 秒后自动跳转... ",1)):f("",!0)]),_:1},8,["icon","title","sub-title"])]),_:1})])}}},ye=se(ue,[["__scopeId","data-v-c1f8a7e0"]]);export{ye as default};
