1 |
- import{d as X,r as d,u as A,a1 as W,J as Y,a as e,e as Z,K as $,k as ee,v as ae,a3 as te,o as E,q as L,w as l,f as a,O as le,Q as ne,m as M,t as P,h as oe,a4 as re,cN as se,ae as z,a8 as ie,a9 as pe,aa as de,ab as me,a6 as ue,z as ce,E as fe,U as ge,ac as _e,i as he,C as ye,p as we,j as xe,g as be,ad as Fe,__tla as ve}from"./index-2eab2d23.js";import{_ as Ve,__tla as Ne}from"./Verify-7fbc0d94.js";import{_ as ke,__tla as Ee}from"./XButton-f05c5131.js";import{E as Le,__tla as Me}from"./el-link-f0d278a2.js";import{u as h,__tla as Pe}from"./useIcon-0c8123fd.js";import{u as ze,L as y,a as Ce,__tla as Oe}from"./useLogin-a00caa87.js";import{u as Se,__tla as Re}from"./useMessage-171aa63e.js";import{r as w,__tla as Ue}from"./formRules-228bd511.js";import{_ as je}from"./_plugin-vue_export-helper-1b428a4d.js";let C,Ie=Promise.all([(()=>{try{return ve}catch{}})(),(()=>{try{return Ne}catch{}})(),(()=>{try{return Ee}catch{}})(),(()=>{try{return Me}catch{}})(),(()=>{try{return Pe}catch{}})(),(()=>{try{return Oe}catch{}})(),(()=>{try{return Re}catch{}})(),(()=>{try{return Ue}catch{}})()]).then(async()=>{let x;x=(u=>(we("data-v-da8f07e2"),u=u(),xe(),u))(()=>be("img",{alt:"",class:"h-59px w-143px",style:{margin:"0 auto"},src:"/admin-ui-vue3/assets/zxlogo-8cee8fbf.png"},null,-1)),C=je(X({name:"LoginForm",__name:"LoginForm",setup(u){const{t:p}=oe();Se();const O=h({icon:"ep:house"}),S=h({icon:"ep:avatar"}),R=h({icon:"ep:lock"}),b=d(),{validForm:U}=Ce(b),{setLoginState:F,getLoginState:j}=ze(),{currentRoute:I,push:Q}=A(),q=W(),m=d(""),c=d(!1),v=d(),K=d("blockPuzzle"),T=Y(()=>e(j)===y.LOGIN),B={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);z(i)}})(),!await U())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),m.value||(m.value="/"),m.value.indexOf("sso")!==-1?window.location.href=window.location.href.replace("/login?redirect=",""):Q({path:m.value||q.addRouters[0].path})}finally{c.value=!1,N.value.close()}};return $(()=>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&&(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 i=ce,r=fe,f=ge,D=_e,G=Le,g=he,_=ke,H=Ve,J=ye;return ae((E(),L(J,{ref_key:"formLogin",ref:b,model:e(n).loginForm,rules:B,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"?(E(),L(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(O),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(S)},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(D,{modelValue:e(n).loginForm.rememberMe,"onUpdate:modelValue":t[4]||(t[4]=s=>e(n).loginForm.rememberMe=s)},{default:l(()=>[M(P(e(p)("login.remember")),1)]),_:1},8,["modelValue"])]),_:1}),a(r,{offset:6,span:12},{default:l(()=>[a(G,{style:{float:"right"},type:"primary"},{default:l(()=>[M(P(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(H,{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-da8f07e2"]])});export{Ie as __tla,C as default};
|