You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
3.7 KiB
1 lines
3.7 KiB
import{_ as D,s as U,z as w,g as q,h as B,x as K,H as L,c as S,a,d as o,w as s,F as H,I as P,u as j,r as n,o as u,t as z,n as E,k as _,J as y,e as J,K as M,L as O}from"./index-CsSGZIOI.js";import $ from"./tenantDialog-DN6TtJsK.js";const A={class:"login-container"},G={class:"title-container"},Q={class:"title"},W={class:"svg-container"},X={class:"svg-container"},Y={style:{display:"flex","justify-content":"space-between"}},Z={class:"svg-container"},ee={style:{width:"30%"}},oe=["src"],te=Object.assign({name:"loginIndex"},{__name:"index",setup(ae){const F=P(),x=U.userStore(),b=j(),f=w(),h=w(),e=q({loginForm:{userName:"",password:"",captchaCode:"",captcha:""},captchaImg:"",loading:!1,passwordType:"password",redirect:void 0}),k={userName:[{required:!0,trigger:"blur",message:"请输入用户名。"}],captchaCode:[{required:!0,trigger:"blur",message:"请输入验证码。"}],password:[{required:!0,trigger:"blur",message:"请输入密码。"}]};B(()=>{p()}),K(()=>b.query.redirect,l=>{e.redirect=l},{immediate:!0});function p(){L().then(l=>{let{data:t}=l;e.captchaImg="data:image/png;base64,"+t.img,e.loginForm.captcha=t.guid})}function V(){e.passwordType==="password"?e.passwordType="":e.passwordType="password"}function m(){f.value.validate(l=>{if(l)e.loading=!0,M(e.loginForm).then(t=>{let{data:i}=t;if(i.length>1)h.value.openDialog(i);else{let r={userName:e.loginForm.userName,password:e.loginForm.password,tenantId:i[0].id,captcha:e.loginForm.captcha};x.login(r).then(c=>{c.code===1&&F.push({path:"/redirect"+(e.redirect??"/")})})}}).catch(()=>{p(),e.loading=!1});else return console.log("error submit!!"),!1})}return(l,t)=>{const i=n("User"),r=n("el-icon"),c=n("el-input"),g=n("el-form-item"),v=n("Lock"),C=n("View"),N=n("Hide"),T=n("PriceTag"),I=n("el-button"),R=n("el-form");return u(),S(H,null,[a("div",A,[o(R,{ref_key:"loginFormRef",ref:f,model:e.loginForm,rules:k,class:"login-form","auto-complete":"on","label-position":"left"},{default:s(()=>[a("div",G,[a("h3",Q,z(E(O).title)+" 系统登录",1)]),o(g,{prop:"userName"},{default:s(()=>[a("span",W,[o(r,null,{default:s(()=>[o(i)]),_:1})]),o(c,{ref:"userName",modelValue:e.loginForm.userName,"onUpdate:modelValue":t[0]||(t[0]=d=>e.loginForm.userName=d),placeholder:"用户名",type:"text",tabindex:"1","auto-complete":"on"},null,8,["modelValue"])]),_:1}),o(g,{prop:"password"},{default:s(()=>[a("span",X,[o(r,null,{default:s(()=>[o(v)]),_:1})]),(u(),_(c,{key:e.passwordType,modelValue:e.loginForm.password,"onUpdate:modelValue":t[1]||(t[1]=d=>e.loginForm.password=d),type:e.passwordType,placeholder:"密码",tabindex:"2","auto-complete":"on",onKeyup:y(m,["enter"])},null,8,["modelValue","type"])),a("span",{class:"show-pwd",onClick:V},[e.passwordType==="password"?(u(),_(r,{key:0},{default:s(()=>[o(C)]),_:1})):(u(),_(r,{key:1},{default:s(()=>[o(N)]),_:1}))])]),_:1}),a("div",Y,[o(g,{prop:"captchaCode",style:{width:"65%"}},{default:s(()=>[a("span",Z,[o(r,null,{default:s(()=>[o(T)]),_:1})]),o(c,{modelValue:e.loginForm.captchaCode,"onUpdate:modelValue":t[2]||(t[2]=d=>e.loginForm.captchaCode=d),placeholder:"验证码",type:"text",tabindex:"3",onKeyup:y(m,["enter"])},null,8,["modelValue"])]),_:1}),a("div",ee,[a("img",{src:e.captchaImg,style:{width:"100%",height:"47px",color:"#fff"},title:"点击,换一张",onClick:p},null,8,oe)])]),o(I,{loading:e.loading,type:"primary",style:{width:"100%","margin-bottom":"30px",height:"40px"},onClick:m},{default:s(()=>t[3]||(t[3]=[J(" 登录 ")])),_:1},8,["loading"])]),_:1},8,["model"])]),o($,{ref_key:"tenantDialogRef",ref:h,onDialogClose:p,username:e.loginForm.username,password:e.loginForm.password,redirect:e.redirect,captcha:e.loginForm.captcha},null,8,["username","password","redirect","captcha"])],64)}}}),re=D(te,[["__scopeId","data-v-e97d44f1"]]);export{re as default};
|
|
|