数通互联化工云平台
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.1 KiB

import{d as $,x as K,r as d,G as F,f as N,q as t,e as s,b as p,h as o,ar as R,ao as k,u as U,a as j,a1 as h,as as b,j as z,H as A,t as y,aj as D,an as M,N as O,ab as P,p as T,m as G,k as H,_ as L}from"./index-e450010e.js";const Q=_=>(T("data-v-1cc677e6"),_=_(),G(),_),Z={class:"login-container"},J={class:"login-main"},W={class:"login-form"},X=Q(()=>t("div",{class:"login-title"}," 用户登录 ",-1)),Y={class:"p-2"},ee={class:"p-2"},se={class:"p-2"},oe={class:"captcha"},ae=["src"],te={class:"mt-4 text-sm",style:{color:"#333"}},le={class:"ml-4"},ne=$({__name:"index",setup(_){const x=K(),I=U(),g=d(!1),w=d(!1),m=d(!1),C=d(),V=d(k),l=d({username:"ceshi",password:"123456"}),q={username:[{required:!0,trigger:"blur"}],password:[{required:!0,trigger:"blur",validator:E}],verifyCode:[{required:!0,trigger:"blur"}]};function E(a,e,n){e.length<6?n(new Error("密码不能少于6位")):n()}function S(a){const{key:e}=a;w.value=e&&e.length===1&&e>="A"&&e<="Z"}function f(){R().then(({data:a})=>{const{verifyCodeBase64:e,verifyCodeKey:n,captchaid:r,picPath:c}=a;l.value.verifyCodeKey=r,l.value.captchaId=r,C.value=c})}function v(){V.value.validate(a=>{a&&(g.value=!0,x.login(l.value).then(()=>{const e=I.query,n=e.redirect??"/",r=Object.keys(e).reduce((c,u)=>(u!=="redirect"&&(c[u]=e[u]),c),{});H.push({path:n,query:r}),f()}).catch(()=>{f()}).finally(()=>{g.value=!1}))})}return F(()=>{f()}),(a,e)=>{const n=D,r=M,c=O,u=P,B=k;return j(),N("div",Z,[t("div",J,[t("div",W,[s(B,{ref_key:"loginFormRef",ref:V,model:o(l),rules:q},{default:p(()=>[X,s(r,{prop:"username"},{default:p(()=>[t("div",Y,[s(h,{"icon-class":"user"})]),s(n,{ref:"username",modelValue:o(l).username,"onUpdate:modelValue":e[0]||(e[0]=i=>o(l).username=i),class:"flex-1",size:"large",placeholder:a.$t("login.username"),name:"username"},null,8,["modelValue","placeholder"])]),_:1}),s(c,{disabled:o(w)===!1,content:"Caps lock is On",placement:"right"},{default:p(()=>[s(r,{prop:"password"},{default:p(()=>[t("span",ee,[s(h,{"icon-class":"password"})]),s(n,{modelValue:o(l).password,"onUpdate:modelValue":e[1]||(e[1]=i=>o(l).password=i),class:"flex-1",placeholder:"密码",type:o(m)===!1?"password":"input",size:"large",name:"password",onKeyup:[S,b(v,["enter"])]},null,8,["modelValue","type"]),t("span",{class:"mr-2",onClick:e[2]||(e[2]=i=>m.value=!o(m))},[s(h,{"icon-class":o(m)===!1?"eye":"eye-open",class:"text-white cursor-pointer"},null,8,["icon-class"])])]),_:1})]),_:1},8,["disabled"]),s(r,{prop:"captcha"},{default:p(()=>[t("span",se,[s(h,{"icon-class":"verify_code"})]),s(n,{modelValue:o(l).captcha,"onUpdate:modelValue":e[3]||(e[3]=i=>o(l).captcha=i),"auto-complete":"off",placeholder:a.$t("login.verifyCode"),class:"w-[60%]",onKeyup:b(v,["enter"])},null,8,["modelValue","placeholder"]),t("div",oe,[t("img",{src:o(C),onClick:f},null,8,ae)])]),_:1}),s(u,{size:"default",loading:o(g),type:"primary",class:"w-full",onClick:z(v,["prevent"])},{default:p(()=>[A(y(a.$t("login.login")),1)]),_:1},8,["loading"]),t("div",te,[t("span",null,y(a.$t("login.username"))+": ceshi",1),t("span",le,y(a.$t("login.password"))+": 123456",1)])]),_:1},8,["model"])])])])}}});const ce=L(ne,[["__scopeId","data-v-1cc677e6"]]);export{ce as default};