| 1 |
- import{d as B,r as m,u as J,a2 as Q,K as W,a as e,e as X,L as Y,l as Z,x as $,a4 as aa,o as V,v as N,w as o,f as l,P as ea,R as ta,n as k,t as L,h as la,a5 as oa,cC as ra,af as P,a9 as na,aa as sa,ab as ia,ac as pa,a7 as ma,A as da,E as ua,V as ca,ad as fa,i as ga,D as _a,p as ha,k as ya,g as wa,ae as xa,_ as Fa,__tla as ba}from"./index-3f6d2b3a.js";import{_ as va,__tla as Va}from"./Verify-f6d77f2d.js";import{_ as Na,__tla as ka}from"./XButton-c878568a.js";import{E as La,__tla as Pa}from"./el-link-20c70e8d.js";import{u as g,__tla as za}from"./useIcon-62c5d69b.js";import{u as Ea,L as Ma,a as Sa,__tla as Ua}from"./useLogin-1432a1c5.js";import{u as Ra,__tla as Da}from"./useMessage-d75e3be7.js";import{r as _,__tla as Ia}from"./formRules-7bf77ca2.js";let z,ja=Promise.all([(()=>{try{return ba}catch{}})(),(()=>{try{return Va}catch{}})(),(()=>{try{return ka}catch{}})(),(()=>{try{return Pa}catch{}})(),(()=>{try{return za}catch{}})(),(()=>{try{return Ua}catch{}})(),(()=>{try{return Da}catch{}})(),(()=>{try{return Ia}catch{}})()]).then(async()=>{let h;h=(u=>(ha("data-v-1de2631f"),u=u(),ya(),u))(()=>wa("img",{alt:"",class:"w-100px",style:{margin:"0 auto"},src:"/assets/zxlogo-ba620d76.png"},null,-1)),z=Fa(B({name:"LoginForm",__name:"LoginForm",setup(u){const{t:p}=la();Ra();const E=g({icon:"ep:house"}),M=g({icon:"ep:avatar"}),S=g({icon:"ep:lock"}),y=m(),{validForm:U}=Sa(y),{setLoginState:Ca,getLoginState:R}=Ea(),{currentRoute:D,push:I}=J(),j=Q(),d=m(""),c=m(!1),w=m(),C=m("blockPuzzle"),K=W(()=>e(R)===Ma.LOGIN),O={tenantName:[_],username:[_],password:[_]},a=X({isShowPassword:!1,captchaEnable:"false",tenantEnable:"false",loginForm:{tenantName:"\u975E\u7E41\u79D1\u6280",username:"",password:"",captchaVerification:"",rememberMe:!1}}),x=async()=>{a.captchaEnable==="false"?await b({}):w.value.show()},F=m(),b=async r=>{c.value=!0;try{if(await(async()=>{if(a.tenantEnable==="true"){const s=await xa(a.loginForm.tenantName);P(s)}})(),!await U())return;a.loginForm.captchaVerification=r.captchaVerification;const t=await na(a.loginForm);if(!t)return;F.value=sa.service({lock:!0,text:"\u6B63\u5728\u52A0\u8F7D\u7CFB\u7EDF\u4E2D...",background:"rgba(0, 0, 0, 0.7)"}),a.loginForm.rememberMe?ia(a.loginForm):pa(),ma(t),d.value||(d.value="/"),d.value.indexOf("sso")!==-1?window.location.href=window.location.href.replace("/login?redirect=",""):I({path:d.value||j.addRouters[0].path})}finally{c.value=!1,F.value.close()}};return Y(()=>D.value,r=>{var t;d.value=(t=r==null?void 0:r.query)==null?void 0:t.redirect},{immediate:!0}),Z(()=>{(()=>{const r=oa();r&&(a.loginForm={...a.loginForm,username:r.username?r.username:a.loginForm.username,password:r.password?r.password:a.loginForm.password,rememberMe:!!r.rememberMe,tenantName:r.tenantName?r.tenantName:a.loginForm.tenantName})})(),(async()=>{const r=location.host,t=await ra(r);t&&(a.loginForm.tenantName=t.name,P(t.id))})()}),(r,t)=>{const s=da,i=ua,f=ca,T=fa,q=La,v=ga,A=Na,G=va,H=_a;return $((V(),N(H,{ref_key:"formLogin",ref:y,model:e(a).loginForm,rules:O,class:"login-form","label-position":"top","label-width":"120px",size:"large"},{default:o(()=>[l(v,{style:{"margin-right":"-10px","margin-left":"-10px"}},{default:o(()=>[l(i,{span:24,style:{"padding-right":"10px","padding-left":"10px"}},{default:o(()=>[l(s,{class:"flex justify-center"},{default:o(()=>[h]),_:1})]),_:1}),l(i,{span:24,style:{"padding-right":"10px","padding-left":"10px"}},{default:o(()=>[e(a).tenantEnable==="true"?(V(),N(s,{key:0,prop:"tenantName"},{default:o(()=>[l(f,{modelValue:e(a).loginForm.tenantName,"onUpdate:modelValue":t[0]||(t[0]=n=>e(a).loginForm.tenantName=n),placeholder:e(p)("login.tenantNamePlaceholder"),"prefix-icon":e(E),link:"",type:"primary"},null,8,["modelValue","placeholder","prefix-icon"])]),_:1})):ea("",!0)]),_:1}),l(i,{span:24,style:{"padding-right":"10px","padding-left":"10px"}},{default:o(()=>[l(s,{prop:"username"},{default:o(()=>[l(f,{modelValue:e(a).loginForm.username,"onUpdate:modelValue":t[1]||(t[1]=n=>e(a).loginForm.username=n),placeholder:e(p)("login.usernamePlaceholder"),"prefix-icon":e(M)},null,8,["modelValue","placeholder","prefix-icon"])]),_:1})]),_:1}),l(i,{span:24,style:{"padding-right":"10px","padding-left":"10px"}},{default:o(()=>[l(s,{prop:"password"},{default:o(()=>[l(f,{modelValue:e(a).loginForm.password,"onUpdate:modelValue":t[2]||(t[2]=n=>e(a).loginForm.password=n),placeholder:e(p)("login.passwordPlaceholder"),"prefix-icon":e(S),"show-password":"",type:"password",onKeyup:t[3]||(t[3]=ta(n=>x(),["enter"]))},null,8,["modelValue","placeholder","prefix-icon"])]),_:1})]),_:1}),l(i,{span:24,style:{"padding-right":"10px","padding-left":"10px","margin-top":"-20px","margin-bottom":"-20px"}},{default:o(()=>[l(s,null,{default:o(()=>[l(v,{justify:"space-between",style:{width:"100%"}},{default:o(()=>[l(i,{span:6},{default:o(()=>[l(T,{modelValue:e(a).loginForm.rememberMe,"onUpdate:modelValue":t[4]||(t[4]=n=>e(a).loginForm.rememberMe=n)},{default:o(()=>[k(L(e(p)("login.remember")),1)]),_:1},8,["modelValue"])]),_:1}),l(i,{offset:6,span:12},{default:o(()=>[l(q,{style:{float:"right"},type:"primary"},{default:o(()=>[k(L(e(p)("login.forgetPassword")),1)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}),l(i,{span:24,style:{"padding-right":"10px","padding-left":"10px"}},{default:o(()=>[l(s,null,{default:o(()=>[l(A,{loading:e(c),title:e(p)("login.login"),class:"w-[100%]",type:"primary",onClick:t[5]||(t[5]=n=>x())},null,8,["loading","title"])]),_:1})]),_:1}),l(G,{ref_key:"verify",ref:w,captchaType:e(C),imgSize:{width:"400px",height:"200px"},mode:"pop",onSuccess:b},null,8,["captchaType"])]),_:1})]),_:1},8,["model"])),[[aa,e(K)]])}}}),[["__scopeId","data-v-1de2631f"],["__file","D:/zx/mall-newfeifan-zx-admin/src/views/Login/components/LoginForm.vue"]])});export{ja as __tla,z as default};
|