| 1 |
- import{d as W,r as d,u as J,a3 as X,K as Y,a as e,e as Z,L as $,l as ee,x as ae,a5 as te,o as L,v as M,w as l,f as a,Q as le,S as ne,n as E,t as z,h as oe,a6 as re,cM as se,ag as P,aa as ie,ab as pe,ac as de,ad as me,a8 as ue,A as ce,E as fe,W as ge,ae as _e,i as he,D as ye,p as we,k as xe,g as be,af as Fe,_ as ve,__tla as Ve}from"./index-9c79adc6.js";import{_ as Ne,__tla as ke}from"./Verify-dad2d5b4.js";import{_ as Le,__tla as Me}from"./XButton-8387e490.js";import{E as Ee,__tla as ze}from"./el-link-c60abd3c.js";import{u as h,__tla as Pe}from"./useIcon-2e7e4d87.js";import{u as Se,L as y,a as Ce,__tla as Oe}from"./useLogin-78536742.js";import{u as Re,__tla as De}from"./useMessage-eafe91ac.js";import{r as w,__tla as Ue}from"./formRules-c40e988c.js";let S,je=Promise.all([(()=>{try{return Ve}catch{}})(),(()=>{try{return ke}catch{}})(),(()=>{try{return Me}catch{}})(),(()=>{try{return ze}catch{}})(),(()=>{try{return Pe}catch{}})(),(()=>{try{return Oe}catch{}})(),(()=>{try{return De}catch{}})(),(()=>{try{return Ue}catch{}})()]).then(async()=>{let x;x=(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)),S=ve(W({name:"LoginForm",__name:"LoginForm",setup(u){const{t:p}=oe();Re();const C=h({icon:"ep:house"}),O=h({icon:"ep:avatar"}),R=h({icon:"ep:lock"}),b=d(),{validForm:D}=Ce(b),{setLoginState:F,getLoginState:U}=Se(),{currentRoute:j,push:I}=J(),Q=X(),m=d(""),c=d(!1),v=d(),K=d("blockPuzzle"),T=Y(()=>e(U)===y.LOGIN),q={tenantName:[w],username:[w],password:[w]},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 k({}):v.value.show()},N=d(),k=async o=>{c.value=!0;try{if(await(async()=>{if(n.tenantEnable==="true"){const i=await Fe(n.loginForm.tenantName);P(i)}})(),!await D())return;n.loginForm.captchaVerification=o.captchaVerification;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),console.log(t),m.value||(m.value="/"),m.value.indexOf("sso")!==-1?window.location.href=window.location.href.replace("/login?redirect=",""):I({path:m.value||Q.addRouters[0].path})}finally{c.value=!1,N.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,P(t.id))})()}),(o,t)=>{const i=ce,r=fe,f=ge,A=_e,B=Ee,g=he,_=Le,G=Ne,H=ye;return ae((L(),M(H,{ref_key:"formLogin",ref:b,model:e(n).loginForm,rules:q,class:"login-form","label-position":"top","label-width":"120px",size:"large"},{default:l(()=>[a(g,{style:{"margin-right":"-10px","margin-left":"-10px"}},{default:l(()=>[a(r,{span:24,style:{"padding-right":"10px","padding-left":"10px"}},{default:l(()=>[a(i,{class:"justify-center flex"},{default:l(()=>[x]),_:1})]),_:1}),a(r,{span:24,style:{"padding-right":"10px","padding-left":"10px"}},{default:l(()=>[e(n).tenantEnable==="true"?(L(),M(i,{key:0,prop:"tenantName"},{default:l(()=>[a(f,{modelValue:e(n).loginForm.tenantName,"onUpdate:modelValue":t[0]||(t[0]=s=>e(n).loginForm.tenantName=s),placeholder:e(p)("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(i,{prop:"username"},{default:l(()=>[a(f,{modelValue:e(n).loginForm.username,"onUpdate:modelValue":t[1]||(t[1]=s=>e(n).loginForm.username=s),placeholder:e(p)("login.usernamePlaceholder"),"prefix-icon":e(O)},null,8,["modelValue","placeholder","prefix-icon"])]),_:1})]),_:1}),a(r,{span:24,style:{"padding-right":"10px","padding-left":"10px"}},{default:l(()=>[a(i,{prop:"password"},{default:l(()=>[a(f,{modelValue:e(n).loginForm.password,"onUpdate:modelValue":t[2]||(t[2]=s=>e(n).loginForm.password=s),placeholder:e(p)("login.passwordPlaceholder"),"prefix-icon":e(R),"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(i,null,{default:l(()=>[a(g,{justify:"space-between",style:{width:"100%"}},{default:l(()=>[a(r,{span:6},{default:l(()=>[a(A,{modelValue:e(n).loginForm.rememberMe,"onUpdate:modelValue":t[4]||(t[4]=s=>e(n).loginForm.rememberMe=s)},{default:l(()=>[E(z(e(p)("login.remember")),1)]),_:1},8,["modelValue"])]),_:1}),a(r,{offset:6,span:12},{default:l(()=>[a(B,{style:{float:"right"},type:"primary"},{default:l(()=>[E(z(e(p)("login.forgetPassword")),1)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}),a(r,{span:24,style:{"padding-right":"10px","padding-left":"10px"}},{default:l(()=>[a(i,null,{default:l(()=>[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(G,{ref_key:"verify",ref:v,captchaType:e(K),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(i,null,{default:l(()=>[a(g,{gutter:5,justify:"space-between",style:{width:"100%"}},{default:l(()=>[a(r,{span:12},{default:l(()=>[a(_,{title:e(p)("login.btnMobile"),class:"w-[100%]",onClick:t[6]||(t[6]=s=>e(F)(e(y).MOBILE))},null,8,["title"])]),_:1}),a(r,{span:12},{default:l(()=>[a(_,{title:e(p)("login.btnQRCode"),class:"w-[100%]",onClick:t[7]||(t[7]=s=>e(F)(e(y).QR_CODE))},null,8,["title"])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])),[[te,e(T)]])}}}),[["__scopeId","data-v-1de2631f"],["__file","D:/zx/mall-newfeifan-zx-business/src/views/Login/components/LoginForm.vue"]])});export{je as __tla,S as default};
|