Template
1
0
mirror of https://github.com/un-pany/v3-admin-vite.git synced 2025-04-23 04:19:20 +08:00
v3-admin-vite/static/index.b12ef220.js

2 lines
2.5 KiB
JavaScript

import{a as e,R as a,i as s,b as l,e as r,z as o,w as d,Y as i,g as n,D as t,G as u,o as p,u as m,Z as c,$ as g,a0 as f,p as v,C as x,n as _,y as w,_ as h}from"./index.2c753d50.js";import{_ as b}from"./index.vue_vue_type_script_setup_true_lang.409905e9.js";const y=""+new URL("logo-text-2.f252b556.png",import.meta.url).href,V={class:"login-container"},z={class:"login-card"},k=(e=>(t("data-v-8686bd8c"),e=e(),u(),e))((()=>o("div",{class:"title"},[o("img",{src:y})],-1))),C={class:"content"},M={class:"show-code"},U=["src"],q=x(" 登 录 "),R=h(e({__name:"index",setup(e){const t=_(),u=a(null),x=a(!1),h=a(""),y=s({username:"admin",password:"12345678",code:"abcd"}),R={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"}]},j=()=>{var e;null==(e=u.value)||e.validate((e=>{if(!e)return!1;x.value=!0,w().login({username:y.username,password:y.password}).then((()=>{t.push({path:"/"})})).catch((()=>{K(),y.password=""})).finally((()=>{x.value=!1}))}))},K=()=>{y.code="",h.value="/api/v1/login/code?"+1e3*Math.random()};return(e,a)=>{const s=n("el-input"),t=n("el-form-item"),_=n("el-button"),w=n("el-form");return p(),l("div",V,[r(b,{class:"theme-switch"}),o("div",z,[k,o("div",C,[r(w,{ref_key:"loginFormRef",ref:u,model:y,rules:R,onKeyup:i(j,["enter"])},{default:d((()=>[r(t,{prop:"username"},{default:d((()=>[r(s,{modelValue:y.username,"onUpdate:modelValue":a[0]||(a[0]=e=>y.username=e),modelModifiers:{trim:!0},placeholder:"用户名",type:"text",tabindex:"1","prefix-icon":m(c),size:"large"},null,8,["modelValue","prefix-icon"])])),_:1}),r(t,{prop:"password"},{default:d((()=>[r(s,{modelValue:y.password,"onUpdate:modelValue":a[1]||(a[1]=e=>y.password=e),modelModifiers:{trim:!0},placeholder:"密码",type:"password",tabindex:"2","prefix-icon":m(g),size:"large","show-password":""},null,8,["modelValue","prefix-icon"])])),_:1}),r(t,{prop:"code"},{default:d((()=>[r(s,{modelValue:y.code,"onUpdate:modelValue":a[2]||(a[2]=e=>y.code=e),modelModifiers:{trim:!0},placeholder:"验证码",type:"text",tabindex:"3","prefix-icon":m(f),maxlength:"4",size:"large"},null,8,["modelValue","prefix-icon"]),o("span",M,[o("img",{src:h.value,onClick:K},null,8,U)])])),_:1}),r(_,{loading:x.value,type:"primary",size:"large",onClick:v(j,["prevent"])},{default:d((()=>[q])),_:1},8,["loading","onClick"])])),_:1},8,["model","onKeyup"])])])])}}}),[["__scopeId","data-v-8686bd8c"]]);export{R as default};