LoginForm-ef948719.js 6.3 KB

1
  1. import{d as H,r as d,u as W,a2 as X,K as Y,a as e,e as Z,L as $,l as ee,x as ae,a4 as te,o as L,v as E,w as l,f as a,P as le,R as ne,n as P,t as M,h as oe,a5 as re,cP as se,af as R,a9 as ie,aa as pe,ab as de,ac as me,a7 as ue,A as ce,E as fe,V as ge,ad as _e,i as he,D as ye,p as we,k as xe,g as be,ae as Fe,_ as ve,__tla as Ve}from"./index-97de8bf9.js";import{_ as ke,__tla as Ne}from"./Verify-3f1cfa2b.js";import{_ as Le,__tla as Ee}from"./XButton-e7d5b61f.js";import{E as Pe,__tla as Me}from"./el-link-c860f885.js";import{u as w,__tla as Re}from"./useIcon-d78a78b7.js";import{u as ze,L as f,a as Ce,__tla as Se}from"./useLogin-e40805a5.js";import{u as Ie,__tla as Ue}from"./useMessage-ff5a010a.js";import{r as x,__tla as Oe}from"./formRules-e394aee3.js";let z,je=Promise.all([(()=>{try{return Ve}catch{}})(),(()=>{try{return Ne}catch{}})(),(()=>{try{return Ee}catch{}})(),(()=>{try{return Me}catch{}})(),(()=>{try{return Re}catch{}})(),(()=>{try{return Se}catch{}})(),(()=>{try{return Ue}catch{}})(),(()=>{try{return Oe}catch{}})()]).then(async()=>{let b;b=(u=>(we("data-v-1de2631f"),u=u(),xe(),u))(()=>be("img",{alt:"",class:"h-59px w-143px",style:{margin:"0 auto"},src:"/assets/zxlogo-8cee8fbf.png"},null,-1)),z=ve(H({name:"LoginForm",__name:"LoginForm",setup(u){const{t:i}=oe();Ie();const C=w({icon:"ep:house"}),S=w({icon:"ep:avatar"}),I=w({icon:"ep:lock"}),F=d(),{validForm:U}=Ce(F),{setLoginState:g,getLoginState:O}=ze(),{currentRoute:j,push:D}=W(),T=X(),m=d(""),_=d(!1),v=d(),G=d("blockPuzzle"),K=Y(()=>e(O)===f.LOGIN),Q={tenantName:[x],username:[x],password:[x]},n=Z({isShowPassword:!1,captchaEnable:"false",tenantEnable:"false",loginForm:{tenantName:"\u975E\u7E41\u79D1\u6280",username:"",password:"",captchaVerification:"",rememberMe:!1}}),V=async()=>{n.captchaEnable==="false"?await N({}):v.value.show()},k=d(),N=async o=>{_.value=!0;try{if(await(async()=>{if(n.tenantEnable==="true"){const p=await Fe(n.loginForm.tenantName);R(p)}})(),!await U())return;n.loginForm.captchaVerification=o.captchaVerification,console.log(n.loginForm);const t=await ie(n.loginForm);if(!t)return;k.value=pe.service({lock:!0,text:"\u6B63\u5728\u52A0\u8F7D\u7CFB\u7EDF\u4E2D...",background:"rgba(0, 0, 0, 0.7)"}),n.loginForm.rememberMe?de(n.loginForm):me(),ue(t),m.value||(m.value="/"),m.value.indexOf("sso")!==-1?window.location.href=window.location.href.replace("/login?redirect=",""):D({path:m.value||T.addRouters[0].path})}finally{_.value=!1,k.value.close()}};return $(()=>j.value,o=>{var t;m.value=(t=o==null?void 0:o.query)==null?void 0:t.redirect},{immediate:!0}),ee(()=>{(()=>{const o=re();o&&(n.loginForm={...n.loginForm,username:o.username?o.username:n.loginForm.username,password:o.password?o.password:n.loginForm.password,rememberMe:!!o.rememberMe,tenantName:o.tenantName?o.tenantName:n.loginForm.tenantName})})(),(async()=>{const o=location.host,t=await se(o);t&&(n.loginForm.tenantName=t.name,R(t.id))})()}),(o,t)=>{const p=ce,r=fe,h=ge,q=_e,A=Pe,y=he,c=Le,B=ke,J=ye;return ae((L(),E(J,{ref_key:"formLogin",ref:F,model:e(n).loginForm,rules:Q,class:"login-form","label-position":"top","label-width":"120px",size:"large"},{default:l(()=>[a(y,{style:{"margin-right":"-10px","margin-left":"-10px"}},{default:l(()=>[a(r,{span:24,style:{"padding-right":"10px","padding-left":"10px"}},{default:l(()=>[a(p,{class:"justify-center flex"},{default:l(()=>[b]),_:1})]),_:1}),a(r,{span:24,style:{"padding-right":"10px","padding-left":"10px"}},{default:l(()=>[e(n).tenantEnable==="true"?(L(),E(p,{key:0,prop:"tenantName"},{default:l(()=>[a(h,{modelValue:e(n).loginForm.tenantName,"onUpdate:modelValue":t[0]||(t[0]=s=>e(n).loginForm.tenantName=s),placeholder:e(i)("login.tenantNamePlaceholder"),"prefix-icon":e(C),link:"",type:"primary"},null,8,["modelValue","placeholder","prefix-icon"])]),_:1})):le("",!0)]),_:1}),a(r,{span:24,style:{"padding-right":"10px","padding-left":"10px"}},{default:l(()=>[a(p,{prop:"username"},{default:l(()=>[a(h,{modelValue:e(n).loginForm.username,"onUpdate:modelValue":t[1]||(t[1]=s=>e(n).loginForm.username=s),placeholder:e(i)("login.usernamePlaceholder"),"prefix-icon":e(S)},null,8,["modelValue","placeholder","prefix-icon"])]),_:1})]),_:1}),a(r,{span:24,style:{"padding-right":"10px","padding-left":"10px"}},{default:l(()=>[a(p,{prop:"password"},{default:l(()=>[a(h,{modelValue:e(n).loginForm.password,"onUpdate:modelValue":t[2]||(t[2]=s=>e(n).loginForm.password=s),placeholder:e(i)("login.passwordPlaceholder"),"prefix-icon":e(I),"show-password":"",type:"password",onKeyup:t[3]||(t[3]=ne(s=>V(),["enter"]))},null,8,["modelValue","placeholder","prefix-icon"])]),_:1})]),_:1}),a(r,{span:24,style:{"padding-right":"10px","padding-left":"10px","margin-top":"-20px","margin-bottom":"-20px"}},{default:l(()=>[a(p,null,{default:l(()=>[a(y,{justify:"space-between",style:{width:"100%"}},{default:l(()=>[a(r,{span:6},{default:l(()=>[a(q,{modelValue:e(n).loginForm.rememberMe,"onUpdate:modelValue":t[4]||(t[4]=s=>e(n).loginForm.rememberMe=s)},{default:l(()=>[P(M(e(i)("login.remember")),1)]),_:1},8,["modelValue"])]),_:1}),a(r,{offset:6,span:12},{default:l(()=>[a(A,{style:{float:"right"},type:"primary"},{default:l(()=>[P(M(e(i)("login.forgetPassword")),1)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}),a(r,{span:24,style:{"padding-right":"10px","padding-left":"10px"}},{default:l(()=>[a(p,null,{default:l(()=>[a(c,{loading:e(_),title:e(i)("login.login"),class:"w-[100%]",type:"primary",onClick:t[5]||(t[5]=s=>V())},null,8,["loading","title"])]),_:1})]),_:1}),a(B,{ref_key:"verify",ref:v,captchaType:e(G),imgSize:{width:"400px",height:"200px"},mode:"pop",onSuccess:N},null,8,["captchaType"]),a(r,{span:24,style:{"padding-right":"10px","padding-left":"10px"}},{default:l(()=>[a(p,null,{default:l(()=>[a(y,{gutter:5,justify:"space-between",style:{width:"100%"}},{default:l(()=>[a(r,{span:8},{default:l(()=>[a(c,{title:e(i)("login.btnMobile"),class:"w-[100%]",onClick:t[6]||(t[6]=s=>e(g)(e(f).MOBILE))},null,8,["title"])]),_:1}),a(r,{span:8},{default:l(()=>[a(c,{title:e(i)("login.btnQRCode"),class:"w-[100%]",onClick:t[7]||(t[7]=s=>e(g)(e(f).QR_CODE))},null,8,["title"])]),_:1}),a(r,{span:8},{default:l(()=>[a(c,{title:e(i)("login.btnRegister"),class:"w-[100%]",onClick:t[8]||(t[8]=s=>e(g)(e(f).REGISTER))},null,8,["title"])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])),[[te,e(K)]])}}}),[["__scopeId","data-v-1de2631f"],["__file","D:/zx/mall-newfeifan-zx-admin/src/views/Login/components/LoginForm.vue"]])});export{je as __tla,z as default};