PageSourceSearch

https://zerocat.dev/assets/callback-BNPgUAnV.js

js zerocat.dev collected 2026-10-04 08:18:51 UTC 2,455 bytes, 1 lines download raw bytes

1import{_ as k,m as b,k as w,j as R,r as V,l as A,B,V as v,a as U}from"./index-BoXpBSb3.js";import{A as C}from"./AuthCard-BkXuvYNd.js";import{o as I,q as o,u as S,I as l,A as s,z as i,J as c,b3 as d,D as _,l as n}from"./vendor-vuetify-DJzs38r3.js";import"./vendor-primevue-B7BMHKNa.js";import"./vendor-markdown-DdljTr2G.js";const z={class:"oauth-card"},N={key:0,class:"auth-state auth-loading text-center"},P={key:1,class:"auth-state auth-success text-center"},T={class:"text-body-1"},q={key:2,class:"auth-state auth-error text-center"},E={class:"text-body-1"},$={__name:"callback",setup(D){const m=b(),p=w(),r=R(),h=n(!0),u=n(!1),f=n(""),y=n("");I(async()=>{try{const e=typeof m.query.redirect=="string"?m.query.redirect:null;e&&r.setAuthRedirectUrl(e);const x=new URLSearchParams(window.location.search).get("temp_token");if(!x)throw new Error("未找到临时令牌,请重新登录");const a=(await V.get(`/account/oauth/validate-token/${x}`)).data;if(a.status==="success")await A.setUser(a),y.value=a.display_name||a.username,u.value=!0,r.navigateToAuthRedirect(p);else throw new Error(a.message||"令牌验证失败")}
1catch(e){console.error("验证临时令牌时出错:",e),f.value=e.message||"登录过程中发生错误,请重试",u.value=!1}finally{h.value=!1}});function g(){const e=r.authRedirectUrl?`?redirect=${encodeURIComponent(r.authRedirectUrl)}`:"";p.push(`/app/account/login${e}`)}return(e,t)=>(o(),S(C,{subtitle:"登录你的账户"},{default:l(()=>[s("div",z,[h.value?(o(),i("div",N,[c(B,{color:"primary",indeterminate:"",size:"64"}),t[0]||(t[0]=s("h3",{class:"text-h6 mt-4"},"验证中...",-1)),t[1]||(t[1]=s("p",{class:"text-body-1"},"正在处理您的登录请求,请稍候",-1))])):u.value?(o(),i("div",P,[c(v,{class:"mb-4",color:"success",size:"64"},{default:l(()=>[...t[2]||(t[2]=[d(" mdi-check-circle ",-1)])]),_:1}),t[3]||(t[3]=s("h3",{class:"text-h6"},"登录成功",-1)),s("p",T,"欢迎回来,"+_(y.value),1),t[4]||(t[4]=s("p",{class:"text-body-2 text-medium-emphasis"},"正在跳转到首页...",-1))])):(o(),i("div",q,[c(v,{class:"mb-4",color:"error",size:"64"},{default:l(()=>[...t[5]||(t[5]=[d(" mdi-alert-circle ",-1)])]),_:1}),t[7]||(t[7]=s("h3",{class:"text-h6"},"登录失败",-1)),s("p",E,_(f.value),1),c(U,{class:"mt-4",color:"primary",variant:"text",onClick:g},{default:l(()=>[...t[6]||(t[6]=[d(" 返回登录 ",-1)])]),_:1})]))])]),_:1}))}},G=k($,[["__scopeId","data-v-e826fd4e"]]);export{G as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.