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.