1import{d as z,a as A,O as Y,x as H,s as n,P as J,H as Q,J as j,e as f,f as b,l as t,g as p,h as a,w as i,by as K,aB as X,bM as Z,N as ee,n as te,t as T,bB as oe,i as w,z as le,_ as ae,bN as ne,bO as re,aY as se,bP as ie,bQ as ue,bR as de,bS as me,G as ce}from"./BkVbg4ZN.js";const fe={class:"xy-center min-h-screen bg-[#f6f7fc] px-[2.4rem]"},be={key:0,class:"w-[60rem] rounded-[1.2rem] bg-white px-[12rem] pt-[6rem] pb-[8rem] text-[1.4rem] text-d71"},pe={class:"yx-center"},_e={class:"login-code-row"},ve=["disabled"],we={key:1,class:"text-center text-[1.4rem] text-d71"},ye={class:"m-0"},xe={key:0,class:"mt-[1.2rem] m-0"},ge={key:1,class:"mt-[1.2rem] m-0 text-[1.3rem] text-8b9"},F=60,he=z({__name:"wechatcallback",setup(Ne){const h=A(),O=Y(),{$message:P}=H(),_=n(),N=n(null),C=n("æ£å¨å®æå¾®ä¿¡ç»å½â¦"),V=n(!1),k=n(!1),y=n(!1),u=n(!0),v=n(F),s=n(!1),r=J({mobileNumber:"",mobileCode:""});let x="",B="",d="",m=null;const q={mobileNumber:[{required:!0,trigger:"blur",validator:(o,e,l)=>{if(!e)return l(new Error("ææºå·ä¸è½ä¸ºç©º"));if(!/^1[0-9]{10}$/.test(String(e)))return l(new Error("ææºå·æ ¼å¼ä¸æ£ç¡®"));l()}}],mobileCode:[{min:6,required:!0,message:"请æ£ç¡®è¾å
¥6ä½éªè¯ç ",trigger:"blur"}]};function R(o){V.value=!0,C.value=o}function E(){d="",s.value=!1,N.value?.reset()}function M(){m&&(clearInterval(m),m=null)}function S(o){window.location.href=me(B,o)}async function U(){if(!(m||!_.value)){try{await _.value.validateField("mobileNumber")}catch{P.warning("请å
è¾å
¥æ£ç¡®çææºå·"),E();return}if(!d){s.value=!0;return}try{await ne({mobileNumber:r.mobileNumber,captchaVerifyParam:d,sendType:re.BINDING})}catch{E();return}u.value=!1,v.value=F,m=se(()=>{v.value-=1,!(v.value>0)&&(M(),u.value=!0)},1e3)}}function D(o){d=o,s.value=!1,U()}async function L(){if(await _.value?.validate().catch(()=>!1)){if(!d){s.value=!0;return}y.value=!0;try{const e=await ie({code:x,mobileNumber:r.mobileNumber,mobileCode:r.mobileCode});S(e?.ticket)}finally{y.value=!1}}}async function W(){if(window.parent!==window){window.top?.location.replace(window.location.href);return}const o=String(h.query.code||""),e=new URL(O.resolve("/chat").href,window.location.origin);if(B=ue(h.query.serve,e.href),!o){R("æªè·åå°å¾®ä¿¡ææ code");return}x=o;try{const l=await de({code:o});if(l?.action==="bindMobile"){x=l?.wxCode||o,k.value=!0;return}S(l?.ticket)}catch{R("微信ç»å½å¤±è´¥ï¼è¯·è¿ååéè¯")}}return Q(()=>{W()}),j(()=>{M()}),(o,e)=>{const l=X,g=K,G=oe,$=le,I=ae;return b(),f("div",fe,[t(k)?(b(),f("div",be,[p("div",pe,[e[4]||(e[4]=p("p",{class:"mb-[3.2rem] text-center text-[2rem] font-semibold text-533"}," ç»å®ææºå· ",-1)),a(G,{ref_key:"bindFormRef",ref:_,class:"login-form w-full",rules:q,model:t(r)},{default:i(()=>[a(g,{prop:"mobileNumber"},{default:i(()=>[a(l,{modelValue:t(r).mobileNumber,"onUpdate:modelValue":e[0]||(e[0]=c=>t(r).mobileNumber=c),modelModifiers:{trim:!0},placeholder:"请è¾å
¥ææºå·"},null,8,["modelValue"])]),_:1}),a(g,null,{default:i(()=>[a(Z,{ref_key:"validationRef",ref:N,modelValue:t(s),"onUpdate:modelValue":e[1]||(e[1]=c=>ee(s)?s.value=c:null),"base-label":"微信ç»å®ææº",onVerify:D},null,8,["modelValue"])]),_:1}),a(g,{prop:"mobileCode"},{default:i(()=>[p("div",_e,[a(l,{modelValue:t(r).mobileCode,"onUpdate:modelValue":e[2]||(e[2]=c=>t(r).mobileCode=c),modelModifiers:{trim:!0},placeholder:"请è¾å
¥éªè¯ç "},null,8,["modelValue"]),p("button",{type:"button",class:te(["login-code-action",t(u)?"is-ready":"is-wait"]),disabled:!t(u),onClick:U},T(t(u)?"è·åéªè¯ç ":`${t(v)} såéå`),11,ve)])]),_:1})]),_:1},8,["model"]),a($,{type:"primary",class:"bind-submit mt-[1.8rem] mb-[1.6rem] w-full",loading:t(y),onClick:L},{default:i(()=>[...e[3]||(e[3]=[w(" 宿 ",-1)])]),_:1},8,["loading"])])])):(b(),f("div",we,[p("p",ye,T(t(C)),1),t(V)?(b(),f("p",xe,[a(I,{class:"text-[#274ab5]",to:"/chat"},{default:i(()=>[...e[5]||(e[5]=[w("è¿åé¦é¡µ",-1)])]),_:1})])):(b(),f("p",ge,[e[7]||(e[7]=w(" å¦æé¿æ¶é´æªååºï¼ ",-1)),a(I,{class:"text-[#274ab5]",to:"/chat"},{default:i(()=>[...e[6]||(e[6]=[w("ç¹å»æ¤å¤è¿å",-1)])]),_:1})]))]))])}}}),Ve=ce(he,[["__scopeId","data-v-12250e25"]]);export{Ve 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.