MobileForm-DT80Jks3.js 2.7 KB

1
  1. var _=(y,i,s)=>new Promise((d,m)=>{var f=o=>{try{c(s.next(o))}catch(r){m(r)}},u=o=>{try{c(s.throw(o))}catch(r){m(r)}},c=o=>o.done?d(o.value):Promise.resolve(o.value).then(f,u);c((s=s.apply(y,i)).next())});import{d as w,f as k,r as B,e as E,u as e,aq as R,ah as M,ar as D,F as z,k as t,aD as l,G as S,au as v,J as N}from"./vue-vendor-Be68asQ6.js";import{a5 as x,j as O,B as h}from"./antd-vue-vendor-DcqS7Wvq.js";import{C as T}from"./index-Bi7PIj53.js";import V from"./LoginFormTitle-C9V36Q53.js";import{bK as U,bL as $,ah as A,bQ as G,N as j,u as q,bM as J,b4 as K,bO as P}from"./index-BFfnEkVs.js";import"./useCountdown-B7iR27pS.js";import"./index-CETWS1o0.js";import"./BasicModal-D4gc2R81.js";import"./useTimeout-Ca5eqGu-.js";import"./vxe-table-vendor-DHF2TRpV.js";import"./useWindowSizeFn-BTSGGcie.js";import"./index-BZ_MXCtW.js";import"./index-BIPzXG41.js";import"./index-CXEQnmRq.js";import"./useIntersectionObserver-Bl62RIZ4.js";import"./useFormItemSingle-nLM0QlcI.js";const ce=w({__name:"MobileForm",setup(y){const i=x.Item,{t:s}=j(),{handleBackLogin:d,getLoginState:m}=U(),{getFormRules:f}=$(),{notification:u,createErrorModal:c}=q(),o=A(),r=k(),g=k(!1),n=B({mobile:"",sms:""}),{validForm:C}=J(r),F=E(()=>e(m)===G.MOBILE);function I(){return _(this,null,function*(){const p=yield C();if(p)try{g.value=!0;const a=yield o.phoneLogin(N({mobile:p.mobile,captcha:p.sms,mode:"none"}));a&&u.success({message:s("sys.login.loginSuccessTitle"),description:`${s("sys.login.loginSuccessDesc")}: ${a.realname}`,duration:3})}catch(a){u.error({message:s("sys.api.errorTip"),description:a.message||s("sys.api.networkExceptionMsg"),duration:3})}finally{g.value=!1}})}function L(){return K({mobile:n.mobile,smsmode:P.FORGET_PASSWORD})}return(p,a)=>F.value?(D(),R(z,{key:0},[t(V,{class:"enter-x"}),t(e(x),{class:"p-4 enter-x",model:n,rules:e(f),ref_key:"formRef",ref:r},{default:l(()=>[t(e(i),{name:"mobile",class:"enter-x"},{default:l(()=>[t(e(O),{size:"large",value:n.mobile,"onUpdate:value":a[0]||(a[0]=b=>n.mobile=b),placeholder:e(s)("sys.login.mobile"),class:"fix-auto-fill"},null,8,["value","placeholder"])]),_:1}),t(e(i),{name:"sms",class:"enter-x"},{default:l(()=>[t(e(T),{size:"large",class:"fix-auto-fill",value:n.sms,"onUpdate:value":a[1]||(a[1]=b=>n.sms=b),placeholder:e(s)("sys.login.smsCode"),sendCodeApi:L},null,8,["value","placeholder"])]),_:1}),t(e(i),{class:"enter-x"},{default:l(()=>[t(e(h),{type:"primary",size:"large",block:"",onClick:I,loading:g.value},{default:l(()=>[S(v(e(s)("sys.login.loginButton")),1)]),_:1},8,["loading"]),t(e(h),{size:"large",block:"",class:"mt-4",onClick:e(d)},{default:l(()=>[S(v(e(s)("sys.login.backSignIn")),1)]),_:1},8,["onClick"])]),_:1})]),_:1},8,["model","rules"])],64)):M("",!0)}});export{ce as default};