1 |
- import{d as G,af as J,u as Q,r as g,e as W,a as e,x as w,w as X,k as Y,v as Z,o as _,C,A as l,f as a,a2 as h,c as S,E as V,P as $,cb as ee,ap as ae,aq as le,al as I,cc as te,ab as oe,U as ne,H as ie,a8 as re,K as se,V as de,__tla as me}from"./index-6e0fa573.js";import{_ as ce,__tla as pe}from"./XButton-fdd634a9.js";import{u as b,__tla as ue}from"./useIcon-3a33dd73.js";import{_ as ge,__tla as _e}from"./LoginFormTitle.vue_vue_type_script_setup_true_lang-f7a2957e.js";import{u as fe,L as he,a as be,__tla as ye}from"./useLogin-8d258cd9.js";import{u as xe,__tla as ve}from"./useMessage-7f978edc.js";import{r as y,__tla as ke}from"./formRules-fc997671.js";import{_ as Fe}from"./_plugin-vue_export-helper-1b428a4d.js";let L,Ne=Promise.all([(()=>{try{return me}catch{}})(),(()=>{try{return pe}catch{}})(),(()=>{try{return ue}catch{}})(),(()=>{try{return _e}catch{}})(),(()=>{try{return ye}catch{}})(),(()=>{try{return ve}catch{}})(),(()=>{try{return ke}catch{}})()]).then(async()=>{let x;x={key:1,class:"getMobileCode",style:{cursor:"pointer"}},L=Fe(G({name:"MobileForm",__name:"MobileForm",setup(we){const{t:i}=$(),M=xe(),E=J(),{currentRoute:P,push:U}=Q(),v=g(),p=g(!1),R=b({icon:"ep:house"}),q=b({icon:"ep:cellphone"}),z=b({icon:"ep:circle-check"}),{validForm:B}=be(v),{handleBackLogin:j,getLoginState:A}=fe(),H=W(()=>e(A)===he.MOBILE),K={tenantName:[y],mobileNumber:[y],code:[y]},t=w({codeImg:"",tenantEnable:"false",token:"",loading:{signIn:!1},loginForm:{uuid:"",tenantName:"\u975E\u7E41\u6E90\u7801",mobileNumber:"",code:""}}),c=w({smsCode:{mobile:"",scene:21},loginSms:{mobile:"",code:""}}),r=g(0),u=g(""),O=async()=>{await k(),c.smsCode.mobile=t.loginForm.mobileNumber,await ee(c.smsCode).then(async()=>{M.success(i("login.SmsSendMsg")),r.value=60;let n=setInterval(()=>{r.value=r.value-1,r.value<=0&&clearInterval(n)},1e3)})};X(()=>P.value,n=>{var o;u.value=(o=n==null?void 0:n.query)==null?void 0:o.redirect},{immediate:!0});const k=async()=>{if(t.tenantEnable==="true"){const n=await ae(t.loginForm.tenantName);le(n)}};return(n,o)=>{const m=ne,s=ie,f=re,F=se,N=ce,T=de;return Y((_(),C(T,{ref_key:"formSmsLogin",ref:v,model:e(t).loginForm,rules:K,class:"login-form","label-position":"top","label-width":"120px",size:"large"},{default:l(()=>[a(F,{style:{"margin-right":"-10px","margin-left":"-10px"}},{default:l(()=>[a(s,{span:24,style:{"padding-right":"10px","padding-left":"10px"}},{default:l(()=>[a(m,null,{default:l(()=>[a(ge,{style:{width:"100%"}})]),_:1})]),_:1}),a(s,{span:24,style:{"padding-right":"10px","padding-left":"10px"}},{default:l(()=>[e(t).tenantEnable==="true"?(_(),C(m,{key:0,prop:"tenantName"},{default:l(()=>[a(f,{modelValue:e(t).loginForm.tenantName,"onUpdate:modelValue":o[0]||(o[0]=d=>e(t).loginForm.tenantName=d),placeholder:e(i)("login.tenantNamePlaceholder"),"prefix-icon":e(R),type:"primary",link:""},null,8,["modelValue","placeholder","prefix-icon"])]),_:1})):h("",!0)]),_:1}),a(s,{span:24,style:{"padding-right":"10px","padding-left":"10px"}},{default:l(()=>[a(m,{prop:"mobileNumber"},{default:l(()=>[a(f,{modelValue:e(t).loginForm.mobileNumber,"onUpdate:modelValue":o[1]||(o[1]=d=>e(t).loginForm.mobileNumber=d),placeholder:e(i)("login.mobileNumberPlaceholder"),"prefix-icon":e(q)},null,8,["modelValue","placeholder","prefix-icon"])]),_:1})]),_:1}),a(s,{span:24,style:{"padding-right":"10px","padding-left":"10px"}},{default:l(()=>[a(m,{prop:"code"},{default:l(()=>[a(F,{gutter:5,justify:"space-between",style:{width:"100%"}},{default:l(()=>[a(s,{span:24},{default:l(()=>[a(f,{modelValue:e(t).loginForm.code,"onUpdate:modelValue":o[2]||(o[2]=d=>e(t).loginForm.code=d),placeholder:e(i)("login.codePlaceholder"),"prefix-icon":e(z)},{append:l(()=>[e(r)<=0?(_(),S("span",{key:0,class:"getMobileCode",style:{cursor:"pointer"},onClick:O},V(e(i)("login.getSmsCode")),1)):h("",!0),e(r)>0?(_(),S("span",x,V(e(r))+"\u79D2\u540E\u53EF\u91CD\u65B0\u83B7\u53D6 ",1)):h("",!0)]),_:1},8,["modelValue","placeholder","prefix-icon"])]),_:1})]),_:1})]),_:1})]),_:1}),a(s,{span:24,style:{"padding-right":"10px","padding-left":"10px"}},{default:l(()=>[a(m,null,{default:l(()=>[a(N,{loading:e(p),title:e(i)("login.login"),class:"w-[100%]",type:"primary",onClick:o[3]||(o[3]=d=>(async()=>{await k(),await B()&&(I.service({lock:!0,text:"\u6B63\u5728\u52A0\u8F7D\u7CFB\u7EDF\u4E2D...",background:"rgba(0, 0, 0, 0.7)"}),p.value=!0,c.loginSms.mobile=t.loginForm.mobileNumber,c.loginSms.code=t.loginForm.code,await te(c.loginSms).then(async D=>{oe(D),u.value||(u.value="/"),U({path:u.value||E.addRouters[0].path})}).catch(()=>{}).finally(()=>{p.value=!1,setTimeout(()=>{I.service().close()},400)}))})())},null,8,["loading","title"])]),_:1})]),_:1}),a(s,{span:24,style:{"padding-right":"10px","padding-left":"10px"}},{default:l(()=>[a(m,null,{default:l(()=>[a(N,{loading:e(p),title:e(i)("login.backLogin"),class:"w-[100%]",onClick:o[4]||(o[4]=d=>e(j)())},null,8,["loading","title"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])),[[Z,e(H)]])}}}),[["__scopeId","data-v-d2378c98"]])});export{Ne as __tla,L as default};
|