mirror of
https://github.com/un-pany/v3-admin-vite.git
synced 2025-04-23 04:19:20 +08:00
2 lines
3.4 KiB
JavaScript
2 lines
3.4 KiB
JavaScript
import{l as V,m as F,p as b,I as U,aL as R,r as u,aD as q,Z as M,ah as n,U as e,u as l,q as p,O as s,a2 as N,S as E,a8 as L,aH as O,aI as $}from"./vue-Dve2Dm07.js";import{_ as B,f as D,e as K}from"./index-CACHgFGX.js";import{v as A,w as H,x as J,y as T,z as Z}from"./element-BBBeT0ZC.js";import{_ as j}from"./index.vue_vue_type_script_setup_true_lang-DanX6j4X.js";import"./vxe-BcNhRZsL.js";const G="/v3-admin-vite/static/logo-text-2-CVewf8RJ.png",P=R('<div class="hand-down-left" data-v-957a4d98></div><div class="hand-down-right" data-v-957a4d98></div><div class="hand-up-left" data-v-957a4d98></div><div class="hand-up-right" data-v-957a4d98></div><div class="close-eyes" data-v-957a4d98></div>',5),Q=[P],W=V({__name:"Owl",props:{closeEyes:{type:Boolean}},setup(o){const c=o;return(m,h)=>(F(),b("div",{class:U(["owl",{"owl-password":c.closeEyes}])},Q,2))}}),X=B(W,[["__scopeId","data-v-957a4d98"]]);function Y(){const o=u(!1);return{isFocus:o,handleBlur:()=>{o.value=!1},handleFocus:()=>{o.value=!0}}}const ee=o=>(O("data-v-00fec942"),o=o(),$(),o),oe={class:"login-container"},ae={class:"login-card"},se=ee(()=>p("div",{class:"title"},[p("img",{src:G})],-1)),te={class:"content"},le=V({__name:"index",setup(o){const c=q(),{isFocus:m,handleBlur:h,handleFocus:C}=Y(),w=u(null),_=u(!1),f=u(""),a=M({username:"admin",password:"12345678",code:""}),k={username:[{required:!0,message:"请输入用户名",trigger:"blur"}],password:[{required:!0,message:"请输入密码",trigger:"blur"},{min:8,max:16,message:"长度在 8 到 16 个字符",trigger:"blur"}],code:[{required:!0,message:"请输入验证码",trigger:"blur"}]},x=()=>{var r;(r=w.value)==null||r.validate((t,d)=>{t?(_.value=!0,K().login(a).then(()=>{c.push({path:"/"})}).catch(()=>{g(),a.password=""}).finally(()=>{_.value=!1})):console.error("表单校验不通过",d)})},g=()=>{a.code="",f.value="",D().then(r=>{f.value=r.data})};return g(),(r,t)=>{const d=n("el-input"),v=n("el-form-item"),y=n("el-icon"),I=n("el-image"),z=n("el-button"),S=n("el-form");return F(),b("div",oe,[e(j,{class:"theme-switch"}),e(X,{"close-eyes":l(m)},null,8,["close-eyes"]),p("div",ae,[se,p("div",te,[e(S,{ref_key:"loginFormRef",ref:w,model:a,rules:k,onKeyup:L(x,["enter"])},{default:s(()=>[e(v,{prop:"username"},{default:s(()=>[e(d,{modelValue:a.username,"onUpdate:modelValue":t[0]||(t[0]=i=>a.username=i),modelModifiers:{trim:!0},placeholder:"用户名",type:"text",tabindex:"1","prefix-icon":l(A),size:"large"},null,8,["modelValue","prefix-icon"])]),_:1}),e(v,{prop:"password"},{default:s(()=>[e(d,{modelValue:a.password,"onUpdate:modelValue":t[1]||(t[1]=i=>a.password=i),modelModifiers:{trim:!0},placeholder:"密码",type:"password",tabindex:"2","prefix-icon":l(H),size:"large","show-password":"",onBlur:l(h),onFocus:l(C)},null,8,["modelValue","prefix-icon","onBlur","onFocus"])]),_:1}),e(v,{prop:"code"},{default:s(()=>[e(d,{modelValue:a.code,"onUpdate:modelValue":t[2]||(t[2]=i=>a.code=i),modelModifiers:{trim:!0},placeholder:"验证码",type:"text",tabindex:"3","prefix-icon":l(J),maxlength:"7",size:"large"},{append:s(()=>[e(I,{src:f.value,onClick:g,draggable:"false"},{placeholder:s(()=>[e(y,null,{default:s(()=>[e(l(T))]),_:1})]),error:s(()=>[e(y,null,{default:s(()=>[e(l(Z))]),_:1})]),_:1},8,["src"])]),_:1},8,["modelValue","prefix-icon"])]),_:1}),e(z,{loading:_.value,type:"primary",size:"large",onClick:N(x,["prevent"])},{default:s(()=>[E("登 录")]),_:1},8,["loading"])]),_:1},8,["model"])])])])}}}),ue=B(le,[["__scopeId","data-v-00fec942"]]);export{ue as default};
|