1 |
- import{d as $,$ as D,u as J,r as g,b as Q,a as e,f as k,aP as W,C as X,a1 as Y,o as _,l as C,w as l,i as a,a2 as h,c as S,t as V,n as Z,di as ee,ae,af as le,a8 as L,dj as te,a5 as oe,H as ne,E as ie,U as re,s as se,K as de,_ as me,__tla as ue}from"./index-390579cd.js";import{_ as ce,__tla as pe}from"./XButton-d3b8169d.js";import{u as b,__tla as ge}from"./useIcon-63cb8546.js";import _e,{__tla as fe}from"./LoginFormTitle-75a438c3.js";import{u as he,L as be,a as ye,__tla as xe}from"./useLogin-45970e2c.js";import{u as ve,__tla as Fe}from"./useMessage-6684a162.js";import{r as y,__tla as we}from"./formRules-9ae1a6b2.js";let M,Ne=Promise.all([(()=>{try{return ue}catch{}})(),(()=>{try{return pe}catch{}})(),(()=>{try{return ge}catch{}})(),(()=>{try{return fe}catch{}})(),(()=>{try{return xe}catch{}})(),(()=>{try{return Fe}catch{}})(),(()=>{try{return we}catch{}})()]).then(async()=>{let x;x={key:1,class:"getMobileCode",style:{cursor:"pointer"}},M=me($({name:"MobileForm",__name:"MobileForm",setup(ke){const{t:i}=Z(),E=ve(),I=D(),{currentRoute:P,push:U}=J(),v=g(),c=g(!1),O=b({icon:"ep:house"}),j=b({icon:"ep:cellphone"}),B=b({icon:"ep:circle-check"}),{validForm:H}=ye(v),{handleBackLogin:R,getLoginState:q}=he(),z=Q(()=>e(q)===be.MOBILE),A={tenantName:[y],mobileNumber:[y],code:[y]},t=k({codeImg:"",tenantEnable:"false",token:"",loading:{signIn:!1},loginForm:{uuid:"",tenantName:"\u975E\u7E41\u6E90\u7801",mobileNumber:"",code:""}}),u=k({smsCode:{mobile:"",scene:21},loginSms:{mobile:"",code:""}}),r=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")),r.value=60;let n=setInterval(()=>{r.value=r.value-1,r.value<=0&&clearInterval(n)},1e3)})};W(()=>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,s=ie,f=re,w=se,N=ce,K=de;return X((_(),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(s,{span:24,style:{"padding-right":"10px","padding-left":"10px"}},{default:l(()=>[a(m,null,{default:l(()=>[a(_e,{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(O),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(j)},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(w,{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(B)},{append:l(()=>[e(r)<=0?(_(),S("span",{key:0,class:"getMobileCode",style:{cursor:"pointer"},onClick:G},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(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(s,{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"])),[[Y,e(z)]])}}}),[["__scopeId","data-v-badf870a"],["__file","E:/GAOHP_2023/mall/newfeifan-front/yudao-ui-admin-vue3/src/views/Login/components/MobileForm.vue"]])});export{Ne as __tla,M as default};
|