This commit is contained in:
1 parent
b9655a5ab1
commit
e292824161
122 files changed
+90002
-69
No files matched your search
@@ -0,0 +1 @@
|
||||
import{r,j as e}from"./react-vendor-jWT2yUdV.js";import{s as P,b,M as me,C as M}from"./index-DiaaLdUu.js";import{c as fe}from"./chunk-5PILOUBS-KHYNqMZE.js";import{c as ge}from"./chunk-D5XJWRAV-DVN21qSw.js";import{i as V}from"./chunk-MLPFQTYO-DSnBqIsb.js";import{t as xe,a as D}from"./chunk-ML27DD5T-ZFWrMOn-.js";import{n as p}from"./react-hot-toast-cGcFZPSt.js";import{g as pe}from"./index-DE7yoXMZ.js";import{l as he}from"./logo-kBMoCJob.js";import{Q as Z,G as je}from"./index-D6HfLP9Q.js";import{P as we,H as ye,T as ve}from"./pure-XNiwTrk_.js";import{a as T}from"./chunk-SXMLSBOY-NckgDZ9w.js";import{d as be,a as Ne,b as Qe,m as Ce}from"./chunk-KQ5CH2X7-DgF-_fDD.js";import{i as K}from"./chunk-2QAN2V2R-B2qCPZrG.js";import{b as ke,c as _e,d as X}from"./index-FvTxWQTZ.js";import{Q as C}from"./qq_manager-BfRTEAby.js";import{s as Se,l as Re}from"./chunk-KVDW62ZT-CGYYmJoP.js";import{a as qe}from"./index-DvErMbt6.js";import{u as Le}from"./use-dialog-CRIMuzeE.js";import{u as Ue}from"./react-router-dom-C6k78GT4.js";import{m as ze}from"./proxy-BsRmjYPH.js";import"./qface-BZLvZXJ8.js";import"./index-BsnVex0g.js";import"./index-BV9-YCKp.js";import"./chunk-UX7UMZL5-CMHjUaC_.js";import"./SelectionManager-Dl9uHsLK.js";import"./usePress-BrNwsdVw.js";import"./layout-Buao20KT.js";import"./gestures-BHfQC-M8.js";import"./features-animation-BkV7kg8P.js";import"./Item-D8Sud-UP.js";import"./iconBase-B7bT1FlI.js";import"./chunk-IHO36JMK-DJPUeGG0.js";import"./chunk-RJKRL3AU-CjtrMR1U.js";import"./chunk-AXSF7SRE-Cr4elNVq.js";import"./chunk-NAV3ZXLI-ChbUTMf0.js";import"./chunk-M3MASYO7-B4fjH-eW.js";import"./chunk-EN4B57RQ-Ief8qCCd.js";import"./useToggle-B3ZYBe5S.js";import"./useFocusable-DA5Croun.js";import"./icons-C0t6aNgu.js";import"./chunk-OPTZHMJX-CY9g90YL.js";import"./chunk-6LIX6LVT-B246pOuK.js";import"./chunk-WQVQ7P2I-BJd1EiqP.js";import"./useHover-DC1o5-bm.js";import"./chunk-2QQAR2RD-YG5LNmAk.js";import"./chunk-FGM523TA-CgSvUh2a.js";import"./chunk-SLABUSGS-Cmz8sGrU.js";import"./DOMLayoutDelegate-DOgfSALU.js";const L=a=>!!a&&"nickName"in a&&"faceUrl"in a;function Pe(a){const l={};try{new URL(a).searchParams.forEach((o,m)=>{l[m]=o})}catch{const n=a.match(/[?&]([^#]+)/);n&&n[1].split("&").forEach(o=>{const[m,i]=o.split("=");m&&(l[m]=decodeURIComponent(i||""))})}return l}function Y(a){return new Promise((l,n)=>{if(window.TencentCaptcha){l();return}const o=document.createElement("script");o.src=a,o.onload=()=>l(),o.onerror=()=>n(new Error(`Failed to load ${a}`)),document.head.appendChild(o)})}const Ee=({proofWaterUrl:a,onSuccess:l,onCancel:n})=>{const o=r.useRef(null),m=r.useRef(!0),i=r.useCallback((d,t)=>{m.current&&(d.ret===0&&d.ticket&&d.randstr?l({ticket:d.ticket,randstr:d.randstr,appid:d.appid||"",sid:t}):n==null||n())},[l,n]);return r.useEffect(()=>{m.current=!0;const d=Pe(a),t=d.aid||"2081081773",g=d.sid||"";return(async()=>{try{await Y("https://captcha.gtimg.com/TCaptcha.js")}catch{try{await Y("https://ssl.captcha.qq.com/TCaptcha.js")}catch{m.current&&i({ret:0,ticket:`terror_1001_${t}_${Math.floor(Date.now()/1e3)}`,randstr:"@"+Math.random().toString(36).substring(2),errorCode:1001,errorMessage:"jsload_error"},g);return}}if(m.current)try{const f=new window.TencentCaptcha(t,h=>i(h,g),{type:"popup",showHeader:!1,login_appid:d.login_appid,uin:d.uin,sid:d.sid,enableAged:!0});o.current=f,f.show()}catch{m.current&&i({ret:0,ticket:`terror_1001_${t}_${Math.floor(Date.now()/1e3)}`,randstr:"@"+Math.random().toString(36).substring(2),errorCode:1001,errorMessage:"init_error"},g)}})(),()=>{var f;m.current=!1,(f=o.current)==null||f.destroy(),o.current=null}},[a,i]),e.jsxs("div",{className:"flex items-center justify-center py-8 gap-3",children:[e.jsx(P,{size:"lg"}),e.jsx("span",{className:"text-default-500",children:"正在加载验证码..."})]})},Ie=({jumpUrl:a,uin:l,onVerified:n,onCancel:o})=>{const[m,i]=r.useState(""),[d,t]=r.useState("loading"),[g,y]=r.useState(""),f=r.useRef(null),h=r.useRef(!0),w=r.useCallback(()=>{f.current&&(clearInterval(f.current),f.current=null)},[]),k=r.useCallback(v=>{w(),f.current=setInterval(async()=>{if(h.current)try{const _=await C.pollNewDeviceQR(l,v);if(!h.current)return;const U=_==null?void 0:_.uint32_guarantee_status;if(U===3)t("scanned");else if(U===1){w(),t("confirmed");const E=(_==null?void 0:_.str_nt_succ_token)||"";n(E)}}catch{}},2500)},[l,n,w]),N=r.useCallback(async()=>{t("loading"),y("");try{const v=await C.getNewDeviceQRCode(l,a);if(!h.current)return;v!=null&&v.str_url?(i(v.str_url),t("waiting"),k(v.bytes_token||"")):(t("error"),y("获取二维码失败,请重试"))}catch(v){if(!h.current)return;t("error"),y(v.message||"获取二维码失败")}},[l,a,k]);r.useEffect(()=>(h.current=!0,N(),()=>{h.current=!1,w()}),[N,w]);const j={loading:"正在获取二维码...",waiting:"请使用手机QQ扫描二维码完成验证",scanned:"已扫描,请在手机上确认",confirmed:"验证成功,正在登录...",error:g||"获取二维码失败"},R={loading:"text-default-500",waiting:"text-warning",scanned:"tLine truncated
|
||||
Reference in new issue
Block a user