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

2 lines
3.3 KiB

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