import{r as o,c as h,o as R,R as U,n as k,K as i,D as s,aj as d,az as E,q as _,t as l,F as B,C as j,H as C,I as v}from"./vendor-vue-WEaOxmRs.js";import{_ as z}from"./index-mJEiaIbQ.js";import"./vendor-element-D7IaNnTz.js";import"./vendor-misc-0uE2ETD1.js";import"./vendor-axios-B9ygI19o.js";const D={class:"auth-wrap"},W={class:"actions"},$={key:0,class:"countdown app-muted"},q={__name:"VerifyResultPage",setup(F){const T=E(),p=o(!1),f=o(""),m=o(""),w=o(""),y=o(""),r=o(""),u=o(""),c=o(""),n=o(0);let a=null;function x(){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 N(e){const t=!!e?.success;p.value=t,f.value=e?.title||(t?"验证成功":"验证失败"),m.value=e?.message||e?.error_message||(t?"操作已完成,现在可以继续使用系统。":"操作失败,请稍后重试。"),w.value=e?.primary_label||(t?"立即登录":"重新注册"),y.value=e?.primary_url||(t?"/login":"/register"),r.value=e?.secondary_label||(t?"":"返回登录"),u.value=e?.secondary_url||(t?"":"/login"),c.value=e?.redirect_url||(t?"/login":""),n.value=Number(e?.redirect_seconds||(t?5:0))||0}const A=h(()=>!!(r.value&&u.value)),b=h(()=>!!(c.value&&n.value>0));async function g(e){if(e){if(e.startsWith("http://")||e.startsWith("https://")){window.location.href=e;return}await T.push(e)}}function P(){b.value&&(a=window.setInterval(()=>{n.value-=1,n.value<=0&&(window.clearInterval(a),a=null,window.location.href=c.value)},1e3))}return R(()=>{const e=x();N(e),P()}),U(()=>{a&&window.clearInterval(a)}),(e,t)=>{const I=d("el-button"),V=d("el-result"),L=d("el-card");return _(),k("div",D,[i(L,{shadow:"never",class:"auth-card","body-style":{padding:"22px"}},{default:s(()=>[t[2]||(t[2]=l("div",{class:"brand"},[l("div",{class:"brand-title"},"知识管理平台"),l("div",{class:"brand-sub app-muted"},"验证结果")],-1)),i(V,{icon:p.value?"success":"error",title:f.value,"sub-title":m.value,class:"result"},{extra:s(()=>[l("div",W,[i(I,{type:"primary",onClick:t[0]||(t[0]=S=>g(y.value))},{default:s(()=>[C(v(w.value),1)]),_:1}),A.value?(_(),j(I,{key:0,onClick:t[1]||(t[1]=S=>g(u.value))},{default:s(()=>[C(v(r.value),1)]),_:1})):B("",!0)]),b.value?(_(),k("div",$,v(n.value)+" 秒后自动跳转... ",1)):B("",!0)]),_:1},8,["icon","title","sub-title"])]),_:1})])}}},O=z(q,[["__scopeId","data-v-1fc6b081"]]);export{O as default};