LoginForm-ceaf5f6a.js 6.3 KB

1
  1. import{d as Z,r as d,u as $,$ as J,b as W,a as e,f as X,aP as Y,B as ee,C as ae,a1 as te,o as E,l as L,w as l,i as a,a2 as le,Q as ne,j as P,t as M,n as oe,a3 as re,dh as se,af as z,a7 as ie,a8 as pe,a9 as de,aa as me,a5 as ue,H as ce,E as fe,U as ge,ab as _e,s as he,K as ye,ac as we,ad as xe,g as be,ae as Fe,_ as ve,__tla as Ve}from"./index-2c56227b.js";import{_ as Ne,__tla as ke}from"./Verify-23690db0.js";import{_ as Ee,__tla as Le}from"./XButton-c87840c8.js";import{E as Pe,__tla as Me}from"./el-link-dfb00afa.js";import{u as w,__tla as ze}from"./useIcon-6e34ed1f.js";import{u as Ce,L as f,a as Re,__tla as Se}from"./useLogin-f2594145.js";import{u as Ue,__tla as Ie}from"./useMessage-96878a4a.js";import{r as x,__tla as Oe}from"./formRules-5c913959.js";let C,je=Promise.all([(()=>{try{return Ve}catch{}})(),(()=>{try{return ke}catch{}})(),(()=>{try{return Le}catch{}})(),(()=>{try{return Me}catch{}})(),(()=>{try{return ze}catch{}})(),(()=>{try{return Se}catch{}})(),(()=>{try{return Ie}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)),C=ve(Z({name:"LoginForm",__name:"LoginForm",setup(u){const{t:i}=oe();Ue();const R=w({icon:"ep:house"}),S=w({icon:"ep:avatar"}),U=w({icon:"ep:lock"}),F=d(),{validForm:I}=Re(F),{setLoginState:g,getLoginState:O}=Ce(),{currentRoute:j,push:G}=$(),Q=J(),m=d(""),_=d(!1),v=d(),T=d("blockPuzzle"),B=W(()=>e(O)===f.LOGIN),H={tenantName:[x],username:[x],password:[x]},n=X({isShowPassword:!1,captchaEnable:"false",tenantEnable:"false",loginForm:{tenantName:"\u975E\u7E41\u79D1\u6280",username:"admin",password:"zx123",captchaVerification:"",rememberMe:!1}}),V=async()=>{n.captchaEnable==="false"?await k({}):v.value.show()},N=d(),k=async o=>{_.value=!0;try{if(await(async()=>{if(n.tenantEnable==="true"){const p=await Fe(n.loginForm.tenantName);z(p)}})(),!await I())return;n.loginForm.captchaVerification=o.captchaVerification,console.log(n.loginForm);const t=await ie(n.loginForm);if(!t)return;N.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=",""):G({path:m.value||Q.addRouters[0].path})}finally{_.value=!1,N.value.close()}};return Y(()=>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,z(t.id))})()}),(o,t)=>{const p=ce,r=fe,h=ge,K=_e,q=Pe,y=he,c=Ee,A=Ne,D=ye;return ae((E(),L(D,{ref_key:"formLogin",ref:F,model:e(n).loginForm,rules:H,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"?(E(),L(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(R),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(U),"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(K,{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(q,{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(A,{ref_key:"verify",ref:v,captchaType:e(T),imgSize:{width:"400px",height:"200px"},mode:"pop",onSuccess:k},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(B)]])}}}),[["__scopeId","data-v-1de2631f"],["__file","E:/GAOHP_2023/mall/newfeifan-front/yudao-ui-admin-vue3/src/views/Login/components/LoginForm.vue"]])});export{je as __tla,C as default};