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.3e93b406.js

2 lines
2.7 KiB
JavaScript

import{b as e,a,r as l,e as s,o as r,f as o,h as d,z as i,w as t,k as n,p as u,B as p,a2 as m,l as c,a3 as f,a4 as g,a5 as _,a6 as v,a7 as x,a8 as h,D as w,G as b,y,_ as V}from"./index.c5f9cdef.js";import{_ as k}from"./index.vue_vue_type_script_setup_true_lang.5d27969f.js";const z={class:"login-container"},q={class:"login-card"},C=(e=>(w("data-v-6f4945e9"),e=e(),b(),e))((()=>i("div",{class:"title"},[i("img",{src:"/v3-admin-vite/static/logo-text-2.eef467fb.png"})],-1))),M={class:"content"},U=V(e({__name:"index",setup(e){const w=c(),b=a(null),V=a(!1),U=a(""),j=l({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"}]},B=()=>{var e;null==(e=b.value)||e.validate((e=>{if(!e)return!1;V.value=!0,y().login({username:j.username,password:j.password,code:j.code}).then((()=>{w.push({path:"/"})})).catch((()=>{D(),j.password=""})).finally((()=>{V.value=!1}))}))},D=()=>{j.code="",U.value="",f().then((e=>{U.value=e.data}))};return D(),(e,a)=>{const l=s("el-input"),c=s("el-form-item"),f=s("el-icon"),w=s("el-image"),y=s("el-button"),F=s("el-form");return r(),o("div",z,[d(k,{class:"theme-switch"}),i("div",q,[C,i("div",M,[d(F,{ref_key:"loginFormRef",ref:b,model:j,rules:K,onKeyup:m(B,["enter"])},{default:t((()=>[d(c,{prop:"username"},{default:t((()=>[d(l,{modelValue:j.username,"onUpdate:modelValue":a[0]||(a[0]=e=>j.username=e),modelModifiers:{trim:!0},placeholder:"用户名",type:"text",tabindex:"1","prefix-icon":n(g),size:"large"},null,8,["modelValue","prefix-icon"])])),_:1}),d(c,{prop:"password"},{default:t((()=>[d(l,{modelValue:j.password,"onUpdate:modelValue":a[1]||(a[1]=e=>j.password=e),modelModifiers:{trim:!0},placeholder:"密码",type:"password",tabindex:"2","prefix-icon":n(_),size:"large","show-password":""},null,8,["modelValue","prefix-icon"])])),_:1}),d(c,{prop:"code"},{default:t((()=>[d(l,{modelValue:j.code,"onUpdate:modelValue":a[2]||(a[2]=e=>j.code=e),modelModifiers:{trim:!0},placeholder:"验证码",type:"text",tabindex:"3","prefix-icon":n(v),maxlength:"7",size:"large"},{append:t((()=>[d(w,{src:U.value,onClick:D,draggable:"false"},{placeholder:t((()=>[d(f,null,{default:t((()=>[d(n(x))])),_:1})])),error:t((()=>[d(f,null,{default:t((()=>[d(n(h))])),_:1})])),_:1},8,["src"])])),_:1},8,["modelValue","prefix-icon"])])),_:1}),d(y,{loading:V.value,type:"primary",size:"large",onClick:u(B,["prevent"])},{default:t((()=>[p(" 登 录 ")])),_:1},8,["loading","onClick"])])),_:1},8,["model","onKeyup"])])])])}}}),[["__scopeId","data-v-6f4945e9"]]);export{U as default};