baAccount-Oxr1Vi4Q.js 4.2 KB

1
  1. import{d as L,a2 as N,a as S,r as A,K as c,aq as C,e as m,f as v,j as t,L as n,u as e,i as r,t as u,m as f,y as z,am as w,ac as G}from"./vue-A59npLRR.js";import{F as B}from"./index-r6iTpmP6.js";import{b as _}from"./validate-_EUdkMt3.js";import{b as $,_ as M}from"./index-EwE51S_X.js";import{u as j,s as g,b as E,c as O}from"./store-F66kEjW2.js";import"./index-K8IR974I.js";import"./baTable-MdxYOkAk.js";import"./index-XALue448.js";import"./echarts-cxb9vJr1.js";const T={key:0,class:"userinfo"},H={class:"user-avatar-box"},J=["src"],Q={class:"username"},W={class:"user-integral"},X={class:"userinfo-buttons"},Y={key:1,class:"ba-login"},Z={class:"ba-title"},ee=["src"],oe={target:"_blank",class:"ba-account-register",href:"https://uni.buildadmin.com/user/login?type=register",rel:"noopener noreferrer"},ae=L({__name:"baAccount",setup(te){const{t:s}=N(),i=j(),b=S(),a=A({loading:!1,form:{tab:"login",username:"",password:"",captcha:"",captchaId:$(),keep:!1}}),U=A({username:[_({name:"required",title:s("module.User name")})],captcha:[_({name:"required",title:s("module.Verification Code")})],password:[_({name:"required",title:s("module.Password")}),_({name:"password"})]}),F=d=>{window.open(d)},y=()=>{b.value&&b.value.validate(d=>{d?(a.loading=!0,O("post",a.form).then(o=>{g.dialog.baAccount=!1,a.loading=!1,i.dataFill(o.data.userInfo)}).catch(()=>{a.loading=!1,h()})):h()})},h=()=>{a.form.captcha="",a.form.captchaId=$()};return(d,o)=>{const q=c("Icon"),p=c("el-button"),D=c("el-input"),V=c("el-col"),P=c("el-row"),k=c("el-form-item"),R=c("el-form"),x=c("el-dialog"),I=C("blur"),K=C("loading");return m(),v("div",null,[t(x,{modelValue:e(g).dialog.baAccount,"onUpdate:modelValue":o[7]||(o[7]=l=>e(g).dialog.baAccount=l),class:"ba-account-dialog",width:"25%",title:e(s)("module.Member information")},{default:n(()=>[e(i).token?w((m(),v("div",T,[r("div",H,[r("img",{class:"user-avatar",src:e(i).avatar,alt:""},null,8,J),t(q,{class:"user-avatar-gender",name:e(i).getGenderIcon().name,size:"14",color:e(i).getGenderIcon().color},null,8,["name","color"])]),r("p",Q,u(e(i).nickname),1),r("p",W,[r("span",null,u(d.$t("module.Integral")+" "+e(i).score),1),r("span",null,u(d.$t("module.Balance")+" "+e(i).money),1)]),r("div",X,[w((m(),z(p,{onClick:o[0]||(o[0]=l=>F("https://uni.buildadmin.com/user/account/moduleOrders")),size:"default",type:"primary"},{default:n(()=>[f(u(d.$t("module.My module")),1)]),_:1})),[[I]]),w((m(),z(p,{onClick:o[1]||(o[1]=l=>e(i).logout()),size:"default",type:"warning"},{default:n(()=>[f(u(d.$t("module.Logout login")),1)]),_:1})),[[I]])])])),[[K,e(g).loading.common]]):(m(),v("div",Y,[r("h3",Z,u(e(s)("module.Log in to the buildadmin module marketplace")),1),t(R,{onKeyup:o[6]||(o[6]=G(l=>y(),["enter"])),ref_key:"baAccountFormRef",ref:b,rules:U,class:"ba-account-login-form",model:a.form},{default:n(()=>[t(B,{modelValue:a.form.username,"onUpdate:modelValue":o[2]||(o[2]=l=>a.form.username=l),type:"string",prop:"username",placeholder:e(s)("module.Please enter buildadmin account name or email"),"input-attr":{size:"large"}},null,8,["modelValue","placeholder"]),t(B,{modelValue:a.form.password,"onUpdate:modelValue":o[3]||(o[3]=l=>a.form.password=l),type:"password",prop:"password",placeholder:e(s)("module.Please enter the buildadmin account password"),"input-attr":{size:"large"}},null,8,["modelValue","placeholder"]),t(k,{prop:"captcha"},{default:n(()=>[t(P,{class:"w100"},{default:n(()=>[t(V,{span:16},{default:n(()=>[t(D,{modelValue:a.form.captcha,"onUpdate:modelValue":o[4]||(o[4]=l=>a.form.captcha=l),size:"large",clearable:"",autocomplete:"off",placeholder:e(s)("module.Please enter the login verification code")},null,8,["modelValue","placeholder"])]),_:1}),t(V,{class:"captcha-box",span:8},{default:n(()=>[r("img",{onClick:h,class:"captcha-img",src:e(E)()+"&id="+a.form.captchaId},null,8,ee)]),_:1})]),_:1})]),_:1}),t(k,{class:"form-buttons"},{default:n(()=>[t(p,{onClick:o[5]||(o[5]=l=>y()),loading:a.loading,round:"",type:"primary",size:"large"},{default:n(()=>[f(u(e(s)("module.Sign in")),1)]),_:1},8,["loading"]),r("a",oe,[t(p,{round:"",plain:"",type:"info",size:"large"},{default:n(()=>[f(u(e(s)("module.Register")),1)]),_:1})])]),_:1})]),_:1},8,["rules","model"])]))]),_:1},8,["modelValue","title"])])}}}),pe=M(ae,[["__scopeId","data-v-2975ba4d"]]);export{pe as default};