| 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 n,i as a,a2 as le,Q as ne,j as P,t as C,n as oe,a3 as re,dh as se,af as R,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 Fe,ae as be,_ as ve,__tla as Ve}from"./index-390579cd.js";import{_ as Ne,__tla as ke}from"./Verify-6dc2a2f1.js";import{_ as Ee,__tla as Le}from"./XButton-d3b8169d.js";import{E as Pe,__tla as Ce}from"./el-link-7a9ae045.js";import{u as h,__tla as Re}from"./useIcon-63cb8546.js";import{u as Se,L as y,a as ze,__tla as Me}from"./useLogin-45970e2c.js";import{u as Oe,__tla as Ue}from"./useMessage-6684a162.js";import{r as w,__tla as je}from"./formRules-9ae1a6b2.js";let S,Ie=Promise.all([(()=>{try{return Ve}catch{}})(),(()=>{try{return ke}catch{}})(),(()=>{try{return Le}catch{}})(),(()=>{try{return Ce}catch{}})(),(()=>{try{return Re}catch{}})(),(()=>{try{return Me}catch{}})(),(()=>{try{return Ue}catch{}})(),(()=>{try{return je}catch{}})()]).then(async()=>{let x;x=(u=>(we("data-v-1de2631f"),u=u(),xe(),u))(()=>Fe("img",{alt:"",class:"h-59px w-143px",style:{margin:"0 auto"},src:"/assets/zxlogo-8cee8fbf.png"},null,-1)),S=ve(Z({name:"LoginForm",__name:"LoginForm",setup(u){const{t:p}=oe();Oe();const z=h({icon:"ep:house"}),M=h({icon:"ep:avatar"}),O=h({icon:"ep:lock"}),F=d(),{validForm:U}=ze(F),{setLoginState:b,getLoginState:j}=Se(),{currentRoute:I,push:G}=$(),Q=J(),m=d(""),c=d(!1),v=d(),T=d("blockPuzzle"),H=W(()=>e(j)===y.LOGIN),K={tenantName:[w],username:[w],password:[w]},l=X({isShowPassword:!1,captchaEnable:"false",tenantEnable:"false",loginForm:{tenantName:"\u975E\u7E41\u79D1\u6280",username:"admin",password:"zx123",captchaVerification:"",rememberMe:!1}}),V=async()=>{l.captchaEnable==="false"?await k({}):v.value.show()},N=d(),k=async o=>{c.value=!0;try{if(await(async()=>{if(l.tenantEnable==="true"){const i=await be(l.loginForm.tenantName);R(i)}})(),!await U())return;l.loginForm.captchaVerification=o.captchaVerification,console.log(l.loginForm);const t=await ie(l.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)"}),l.loginForm.rememberMe?de(l.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{c.value=!1,N.value.close()}};return Y(()=>I.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&&(l.loginForm={...l.loginForm,username:o.username?o.username:l.loginForm.username,password:o.password?o.password:l.loginForm.password,rememberMe:!!o.rememberMe,tenantName:o.tenantName?o.tenantName:l.loginForm.tenantName})})(),(async()=>{const o=location.host,t=await se(o);t&&(l.loginForm.tenantName=t.name,R(t.id))})()}),(o,t)=>{const i=ce,r=fe,f=ge,q=_e,A=Pe,g=he,_=Ee,B=Ne,D=ye;return ae((E(),L(D,{ref_key:"formLogin",ref:F,model:e(l).loginForm,rules:K,class:"login-form","label-position":"top","label-width":"120px",size:"large"},{default:n(()=>[a(g,{style:{"margin-right":"-10px","margin-left":"-10px"}},{default:n(()=>[a(r,{span:24,style:{"padding-right":"10px","padding-left":"10px"}},{default:n(()=>[a(i,{class:"justify-center flex"},{default:n(()=>[x]),_:1})]),_:1}),a(r,{span:24,style:{"padding-right":"10px","padding-left":"10px"}},{default:n(()=>[e(l).tenantEnable==="true"?(E(),L(i,{key:0,prop:"tenantName"},{default:n(()=>[a(f,{modelValue:e(l).loginForm.tenantName,"onUpdate:modelValue":t[0]||(t[0]=s=>e(l).loginForm.tenantName=s),placeholder:e(p)("login.tenantNamePlaceholder"),"prefix-icon":e(z),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:n(()=>[a(i,{prop:"username"},{default:n(()=>[a(f,{modelValue:e(l).loginForm.username,"onUpdate:modelValue":t[1]||(t[1]=s=>e(l).loginForm.username=s),placeholder:e(p)("login.usernamePlaceholder"),"prefix-icon":e(M)},null,8,["modelValue","placeholder","prefix-icon"])]),_:1})]),_:1}),a(r,{span:24,style:{"padding-right":"10px","padding-left":"10px"}},{default:n(()=>[a(i,{prop:"password"},{default:n(()=>[a(f,{modelValue:e(l).loginForm.password,"onUpdate:modelValue":t[2]||(t[2]=s=>e(l).loginForm.password=s),placeholder:e(p)("login.passwordPlaceholder"),"prefix-icon":e(O),"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:n(()=>[a(i,null,{default:n(()=>[a(g,{justify:"space-between",style:{width:"100%"}},{default:n(()=>[a(r,{span:6},{default:n(()=>[a(q,{modelValue:e(l).loginForm.rememberMe,"onUpdate:modelValue":t[4]||(t[4]=s=>e(l).loginForm.rememberMe=s)},{default:n(()=>[P(C(e(p)("login.remember")),1)]),_:1},8,["modelValue"])]),_:1}),a(r,{offset:6,span:12},{default:n(()=>[a(A,{style:{float:"right"},type:"primary"},{default:n(()=>[P(C(e(p)("login.forgetPassword")),1)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}),a(r,{span:24,style:{"padding-right":"10px","padding-left":"10px"}},{default:n(()=>[a(i,null,{default:n(()=>[a(_,{loading:e(c),title:e(p)("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(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:n(()=>[a(i,null,{default:n(()=>[a(g,{gutter:5,justify:"space-between",style:{width:"100%"}},{default:n(()=>[a(r,{span:8},{default:n(()=>[a(_,{title:e(p)("login.btnQRCode"),class:"w-[100%]",onClick:t[6]||(t[6]=s=>e(b)(e(y).QR_CODE))},null,8,["title"])]),_:1}),a(r,{span:8},{default:n(()=>[a(_,{title:e(p)("login.btnRegister"),class:"w-[100%]",onClick:t[7]||(t[7]=s=>e(b)(e(y).REGISTER))},null,8,["title"])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])),[[te,e(H)]])}}}),[["__scopeId","data-v-1de2631f"],["__file","E:/GAOHP_2023/mall/newfeifan-front/yudao-ui-admin-vue3/src/views/Login/components/LoginForm.vue"]])});export{Ie as __tla,S as default};
|