LoginForm-dd1a5934.js 8.0 KB

1
  1. import{d as re,r as u,u as se,a2 as de,b as pe,a as t,f as ce,aS as ue,B as me,C as fe,a3 as ge,o as b,l as U,w as a,i as e,a4 as _e,Q as he,j as p,t as v,g as j,c as ye,k as we,F as xe,n as be,a5 as ve,dp as Fe,af as F,a9 as ke,aa as Ve,ab as Ee,ac as Ne,a7 as De,cs as Ce,ae as z,dq as Le,H as Re,E as Me,U as Pe,ad as Ie,s as Se,q as Ue,v as je,K as ze,_ as Oe,__tla as Qe}from"./index-82e357b2.js";import{_ as Ae,__tla as Ge}from"./Verify-8d6f549a.js";import{_ as Te,__tla as qe}from"./XButton-8f9f0a77.js";import{E as Be,__tla as He}from"./el-link-b4d9deb2.js";import{u as Ke,L as _,a as $e,b as Je,__tla as We}from"./LoginFormTitle-39ad9ab7.js";import{u as k,__tla as Xe}from"./useIcon-056e58dc.js";import{u as Ye,__tla as Ze}from"./useMessage-84d39096.js";import{r as V,__tla as ea}from"./formRules-a5aa0519.js";let O,aa=Promise.all([(()=>{try{return Qe}catch{}})(),(()=>{try{return Ge}catch{}})(),(()=>{try{return qe}catch{}})(),(()=>{try{return He}catch{}})(),(()=>{try{return We}catch{}})(),(()=>{try{return Xe}catch{}})(),(()=>{try{return Ze}catch{}})(),(()=>{try{return ea}catch{}})()]).then(async()=>{let E,N;E={class:"w-[100%] flex justify-between"},N={class:"w-[100%] flex justify-between"},O=Oe(re({name:"LoginForm",__name:"LoginForm",setup(ta){const{t:s}=be(),D=Ye(),Q=k({icon:"ep:house"}),A=k({icon:"ep:avatar"}),G=k({icon:"ep:lock"}),C=u(),{validForm:T}=Je(C),{setLoginState:h,getLoginState:q}=Ke(),{currentRoute:B,push:H}=se(),K=de(),c=u(""),f=u(!1),L=u(),$=u("blockPuzzle"),J=pe(()=>t(q)===_.LOGIN),W={tenantName:[V],username:[V],password:[V]},n=ce({isShowPassword:!1,captchaEnable:"false",tenantEnable:"false",loginForm:{tenantName:"\u975E\u7E41\u79D1\u6280",username:"admin",password:"zx123",captchaVerification:"",rememberMe:!1}}),X=[{icon:"ant-design:wechat-filled",type:30},{icon:"ant-design:dingtalk-circle-filled",type:20},{icon:"ant-design:github-filled",type:0},{icon:"ant-design:alipay-circle-filled",type:0}],R=async()=>{n.captchaEnable==="false"?await I({}):L.value.show()},M=async()=>{if(n.tenantEnable==="true"){const o=await z(n.loginForm.tenantName);F(o)}},P=u(),I=async o=>{f.value=!0;try{if(await M(),!await T())return;n.loginForm.captchaVerification=o.captchaVerification;const l=await ke(n.loginForm);if(!l)return;P.value=Ve.service({lock:!0,text:"\u6B63\u5728\u52A0\u8F7D\u7CFB\u7EDF\u4E2D...",background:"rgba(0, 0, 0, 0.7)"}),n.loginForm.rememberMe?Ee(n.loginForm):Ne(),De(l),c.value||(c.value="/"),c.value.indexOf("sso")!==-1?window.location.href=window.location.href.replace("/login?redirect=",""):H({path:c.value||K.addRouters[0].path})}finally{f.value=!1,P.value.close()}};return ue(()=>B.value,o=>{var l;c.value=(l=o==null?void 0:o.query)==null?void 0:l.redirect},{immediate:!0}),me(()=>{(()=>{const o=ve();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,l=await Fe(o);l&&(n.loginForm.tenantName=l.name,F(l.id))})()}),(o,l)=>{const d=Re,r=Me,y=Pe,Y=Ie,m=Be,w=Se,g=Te,Z=Ae,S=Ue,ee=je,ae=ze;return fe((b(),U(ae,{ref_key:"formLogin",ref:C,model:t(n).loginForm,rules:W,class:"login-form","label-position":"top","label-width":"120px",size:"large"},{default:a(()=>[e(w,{style:{"margin-right":"-10px","margin-left":"-10px"}},{default:a(()=>[e(r,{span:24,style:{"padding-right":"10px","padding-left":"10px"}},{default:a(()=>[e(d,null,{default:a(()=>[e($e,{style:{width:"100%"}})]),_:1})]),_:1}),e(r,{span:24,style:{"padding-right":"10px","padding-left":"10px"}},{default:a(()=>[t(n).tenantEnable==="true"?(b(),U(d,{key:0,prop:"tenantName"},{default:a(()=>[e(y,{modelValue:t(n).loginForm.tenantName,"onUpdate:modelValue":l[0]||(l[0]=i=>t(n).loginForm.tenantName=i),placeholder:t(s)("login.tenantNamePlaceholder"),"prefix-icon":t(Q),link:"",type:"primary"},null,8,["modelValue","placeholder","prefix-icon"])]),_:1})):_e("",!0)]),_:1}),e(r,{span:24,style:{"padding-right":"10px","padding-left":"10px"}},{default:a(()=>[e(d,{prop:"username"},{default:a(()=>[e(y,{modelValue:t(n).loginForm.username,"onUpdate:modelValue":l[1]||(l[1]=i=>t(n).loginForm.username=i),placeholder:t(s)("login.usernamePlaceholder"),"prefix-icon":t(A)},null,8,["modelValue","placeholder","prefix-icon"])]),_:1})]),_:1}),e(r,{span:24,style:{"padding-right":"10px","padding-left":"10px"}},{default:a(()=>[e(d,{prop:"password"},{default:a(()=>[e(y,{modelValue:t(n).loginForm.password,"onUpdate:modelValue":l[2]||(l[2]=i=>t(n).loginForm.password=i),placeholder:t(s)("login.passwordPlaceholder"),"prefix-icon":t(G),"show-password":"",type:"password",onKeyup:l[3]||(l[3]=he(i=>R(),["enter"]))},null,8,["modelValue","placeholder","prefix-icon"])]),_:1})]),_:1}),e(r,{span:24,style:{"padding-right":"10px","padding-left":"10px","margin-top":"-20px","margin-bottom":"-20px"}},{default:a(()=>[e(d,null,{default:a(()=>[e(w,{justify:"space-between",style:{width:"100%"}},{default:a(()=>[e(r,{span:6},{default:a(()=>[e(Y,{modelValue:t(n).loginForm.rememberMe,"onUpdate:modelValue":l[4]||(l[4]=i=>t(n).loginForm.rememberMe=i)},{default:a(()=>[p(v(t(s)("login.remember")),1)]),_:1},8,["modelValue"])]),_:1}),e(r,{offset:6,span:12},{default:a(()=>[e(m,{style:{float:"right"},type:"primary"},{default:a(()=>[p(v(t(s)("login.forgetPassword")),1)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}),e(r,{span:24,style:{"padding-right":"10px","padding-left":"10px"}},{default:a(()=>[e(d,null,{default:a(()=>[e(g,{loading:t(f),title:t(s)("login.login"),class:"w-[100%]",type:"primary",onClick:l[5]||(l[5]=i=>R())},null,8,["loading","title"])]),_:1})]),_:1}),e(Z,{ref_key:"verify",ref:L,captchaType:t($),imgSize:{width:"400px",height:"200px"},mode:"pop",onSuccess:I},null,8,["captchaType"]),e(r,{span:24,style:{"padding-right":"10px","padding-left":"10px"}},{default:a(()=>[e(d,null,{default:a(()=>[e(w,{gutter:5,justify:"space-between",style:{width:"100%"}},{default:a(()=>[e(r,{span:8},{default:a(()=>[e(g,{title:t(s)("login.btnMobile"),class:"w-[100%]",onClick:l[6]||(l[6]=i=>t(h)(t(_).MOBILE))},null,8,["title"])]),_:1}),e(r,{span:8},{default:a(()=>[e(g,{title:t(s)("login.btnQRCode"),class:"w-[100%]",onClick:l[7]||(l[7]=i=>t(h)(t(_).QR_CODE))},null,8,["title"])]),_:1}),e(r,{span:8},{default:a(()=>[e(g,{title:t(s)("login.btnRegister"),class:"w-[100%]",onClick:l[8]||(l[8]=i=>t(h)(t(_).REGISTER))},null,8,["title"])]),_:1})]),_:1})]),_:1})]),_:1}),e(S,{"content-position":"center"},{default:a(()=>[p(v(t(s)("login.otherLogin")),1)]),_:1}),e(r,{span:24,style:{"padding-right":"10px","padding-left":"10px"}},{default:a(()=>[e(d,null,{default:a(()=>[j("div",E,[(b(),ye(xe,null,we(X,(i,te)=>e(ee,{key:te,icon:i.icon,size:30,class:"anticon cursor-pointer",color:"#999",onClick:la=>(async x=>{if(x===0)D.error("\u6B64\u65B9\u5F0F\u672A\u914D\u7F6E");else{f.value=!0,n.tenantEnable==="true"&&(await M(),Ce()||await D.prompt("\u8BF7\u8F93\u5165\u79DF\u6237\u540D\u79F0",s("common.reminder")).then(async({value:oe})=>{const ie=await z(oe);F(ie)}));const le=location.origin+"/social-login?"+encodeURIComponent(`type=${x}&redirect=${c.value||"/"}`),ne=await Le(x,encodeURIComponent(le));window.location.href=ne}})(i.type)},null,8,["icon","onClick"])),64))])]),_:1})]),_:1}),e(S,{"content-position":"center"},{default:a(()=>[p("\u840C\u65B0\u5FC5\u8BFB")]),_:1}),e(r,{span:24,style:{"padding-right":"10px","padding-left":"10px"}},{default:a(()=>[e(d,null,{default:a(()=>[j("div",N,[e(m,{href:"https://doc.iocoder.cn/",target:"_blank"},{default:a(()=>[p("\u{1F4DA}\u5F00\u53D1\u6307\u5357")]),_:1}),e(m,{href:"https://doc.iocoder.cn/video/",target:"_blank"},{default:a(()=>[p("\u{1F525}\u89C6\u9891\u6559\u7A0B")]),_:1}),e(m,{href:"https://www.iocoder.cn/Interview/good-collection/",target:"_blank"},{default:a(()=>[p(" \u26A1\u9762\u8BD5\u624B\u518C ")]),_:1}),e(m,{href:"http://static.yudao.iocoder.cn/mp/Aix9975.jpeg",target:"_blank"},{default:a(()=>[p(" \u{1F91D}\u5916\u5305\u54A8\u8BE2 ")]),_:1})])]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])),[[ge,t(J)]])}}}),[["__scopeId","data-v-1de2631f"],["__file","E:/GAOHP_2023/mall/newfeifan-front/yudao-ui-admin-vue3/src/views/Login/components/LoginForm.vue"]])});export{aa as __tla,O as default};