| 1 |
- import{d as Q,r as m,u as W,a4 as X,L as $,a as e,f as A,M as J,l as Y,y as Z,a6 as aa,o as V,x as N,w as o,g as l,Q as ea,S as ta,n as k,t as L,i as la,a7 as oa,cH as ra,ag as z,aa as na,ab as sa,ac as ia,ad as pa,$ as ma,B as da,E as ua,W as ca,ae as ga,j as fa,G as _a,p as ha,k as ya,h as wa,af as xa,_ as Fa,__tla as ba}from"./index-52b99925.js";import{_ as va,__tla as Va}from"./Verify-50cd6fa0.js";import{_ as Na,__tla as ka}from"./XButton-29a17f60.js";import{E as La,__tla as za}from"./el-link-7281b055.js";import{u as f,__tla as Ea}from"./useIcon-6d5c5c7c.js";import{u as Ma,L as Pa,a as Sa,__tla as Ua}from"./useLogin-9e92b89d.js";import{u as ja,__tla as Ga}from"./useMessage-c41e583e.js";import{r as _,__tla as Ia}from"./formRules-d64fa1d2.js";let E,Ra=Promise.all([(()=>{try{return ba}catch{}})(),(()=>{try{return Va}catch{}})(),(()=>{try{return ka}catch{}})(),(()=>{try{return za}catch{}})(),(()=>{try{return Ea}catch{}})(),(()=>{try{return Ua}catch{}})(),(()=>{try{return Ga}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)),E=Fa(Q({name:"LoginForm",__name:"LoginForm",setup(u){const{t:p}=la();ja();const M=f({icon:"ep:house"}),P=f({icon:"ep:avatar"}),S=f({icon:"ep:lock"}),y=m(),{validForm:U}=Sa(y),{setLoginState:Oa,getLoginState:j}=Ma(),{currentRoute:G,push:I}=W(),R=X(),d=m(""),c=m(!1),w=m(),O=m("blockPuzzle"),T=$(()=>e(j)===Pa.LOGIN),q={tenantName:[_],username:[_],password:[_]},a=A({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);z(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||R.addRouters[0].path})}finally{c.value=!1,F.value.close()}};return J(()=>G.value,r=>{var t;d.value=(t=r==null?void 0:r.query)==null?void 0:t.redirect},{immediate:!0}),Y(()=>{(()=>{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,z(t.id))})()}),(r,t)=>{const s=da,i=ua,g=ca,B=ga,C=La,v=fa,D=Na,H=va,K=_a;return Z((V(),N(K,{ref_key:"formLogin",ref:y,model:e(a).loginForm,rules:q,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(g,{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(M),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(g,{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(P)},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(g,{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(B,{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(C,{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(D,{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(H,{ref_key:"verify",ref:w,captchaType:e(O),imgSize:{width:"400px",height:"200px"},mode:"pop",onSuccess:b},null,8,["captchaType"])]),_:1})]),_:1},8,["model"])),[[aa,e(T)]])}}}),[["__scopeId","data-v-1de2631f"],["__file","D:/zx/mall-newfeifan-zx-admin/src/views/Login/components/LoginForm.vue"]])});export{Ra as __tla,E as default};
|