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