MobileForm-e4b1a4f3.js 4.8 KB

1
  1. import{d as D,a2 as J,u as Q,r as g,b as W,a as e,f as k,aS as X,C as Y,a3 as Z,o as _,l as C,w as l,i as a,a4 as b,c as S,t as V,n as $,dr as ee,ae,af as le,aa as L,ds as te,a7 as oe,H as ne,E as ie,U as se,s as re,K as de,_ as me,__tla as ue}from"./index-82e357b2.js";import{_ as ce,__tla as pe}from"./XButton-8f9f0a77.js";import{u as h,__tla as ge}from"./useIcon-056e58dc.js";import{u as _e,L as fe,a as be,b as he,__tla as ye}from"./LoginFormTitle-39ad9ab7.js";import{u as xe,__tla as ve}from"./useMessage-84d39096.js";import{r as y,__tla as Fe}from"./formRules-a5aa0519.js";let M,we=Promise.all([(()=>{try{return ue}catch{}})(),(()=>{try{return pe}catch{}})(),(()=>{try{return ge}catch{}})(),(()=>{try{return ye}catch{}})(),(()=>{try{return ve}catch{}})(),(()=>{try{return Fe}catch{}})()]).then(async()=>{let x;x={key:1,class:"getMobileCode",style:{cursor:"pointer"}},M=me(D({name:"MobileForm",__name:"MobileForm",setup(Ne){const{t:i}=$(),E=xe(),I=J(),{currentRoute:P,push:U}=Q(),v=g(),c=g(!1),O=h({icon:"ep:house"}),j=h({icon:"ep:cellphone"}),B=h({icon:"ep:circle-check"}),{validForm:H}=he(v),{handleBackLogin:R,getLoginState:q}=_e(),z=W(()=>e(q)===fe.MOBILE),A={tenantName:[y],mobileNumber:[y],code:[y]},t=k({codeImg:"",tenantEnable:"false",token:"",loading:{signIn:!1},loginForm:{uuid:"",tenantName:"\u828B\u9053\u6E90\u7801",mobileNumber:"",code:""}}),u=k({smsCode:{mobile:"",scene:21},loginSms:{mobile:"",code:""}}),s=g(0),p=g(""),G=async()=>{await F(),u.smsCode.mobile=t.loginForm.mobileNumber,await ee(u.smsCode).then(async()=>{E.success(i("login.SmsSendMsg")),s.value=60;let n=setInterval(()=>{s.value=s.value-1,s.value<=0&&clearInterval(n)},1e3)})};X(()=>P.value,n=>{var o;p.value=(o=n==null?void 0:n.query)==null?void 0:o.redirect},{immediate:!0});const F=async()=>{if(t.tenantEnable==="true"){const n=await ae(t.loginForm.tenantName);le(n)}};return(n,o)=>{const m=ne,r=ie,f=se,w=re,N=ce,K=de;return Y((_(),C(K,{ref_key:"formSmsLogin",ref:v,model:e(t).loginForm,rules:A,class:"login-form","label-position":"top","label-width":"120px",size:"large"},{default:l(()=>[a(w,{style:{"margin-right":"-10px","margin-left":"-10px"}},{default:l(()=>[a(r,{span:24,style:{"padding-right":"10px","padding-left":"10px"}},{default:l(()=>[a(m,null,{default:l(()=>[a(be,{style:{width:"100%"}})]),_:1})]),_:1}),a(r,{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(O),type:"primary",link:""},null,8,["modelValue","placeholder","prefix-icon"])]),_:1})):b("",!0)]),_:1}),a(r,{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(j)},null,8,["modelValue","placeholder","prefix-icon"])]),_:1})]),_:1}),a(r,{span:24,style:{"padding-right":"10px","padding-left":"10px"}},{default:l(()=>[a(m,{prop:"code"},{default:l(()=>[a(w,{gutter:5,justify:"space-between",style:{width:"100%"}},{default:l(()=>[a(r,{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(B)},{append:l(()=>[e(s)<=0?(_(),S("span",{key:0,class:"getMobileCode",style:{cursor:"pointer"},onClick:G},V(e(i)("login.getSmsCode")),1)):b("",!0),e(s)>0?(_(),S("span",x,V(e(s))+"\u79D2\u540E\u53EF\u91CD\u65B0\u83B7\u53D6 ",1)):b("",!0)]),_:1},8,["modelValue","placeholder","prefix-icon"])]),_:1})]),_:1})]),_:1})]),_:1}),a(r,{span:24,style:{"padding-right":"10px","padding-left":"10px"}},{default:l(()=>[a(m,null,{default:l(()=>[a(N,{loading:e(c),title:e(i)("login.login"),class:"w-[100%]",type:"primary",onClick:o[3]||(o[3]=d=>(async()=>{await F(),await H()&&(L.service({lock:!0,text:"\u6B63\u5728\u52A0\u8F7D\u7CFB\u7EDF\u4E2D...",background:"rgba(0, 0, 0, 0.7)"}),c.value=!0,u.loginSms.mobile=t.loginForm.mobileNumber,u.loginSms.code=t.loginForm.code,await te(u.loginSms).then(async T=>{oe(T),p.value||(p.value="/"),U({path:p.value||I.addRouters[0].path})}).catch(()=>{}).finally(()=>{c.value=!1,setTimeout(()=>{L.service().close()},400)}))})())},null,8,["loading","title"])]),_:1})]),_:1}),a(r,{span:24,style:{"padding-right":"10px","padding-left":"10px"}},{default:l(()=>[a(m,null,{default:l(()=>[a(N,{loading:e(c),title:e(i)("login.backLogin"),class:"w-[100%]",onClick:o[4]||(o[4]=d=>e(R)())},null,8,["loading","title"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])),[[Z,e(z)]])}}}),[["__scopeId","data-v-badf870a"],["__file","E:/GAOHP_2023/mall/newfeifan-front/yudao-ui-admin-vue3/src/views/Login/components/MobileForm.vue"]])});export{we as __tla,M as default};