import{A as e,D as t,N as n,S as r,_ as i,a,b as o,c as s,d as c,k as l,m as u,o as d,v as f,w as p,y as m}from"./index-jy40eMQa.js";import"./admin-CqpMrZ_s.js";import"./types-WIP_Oieg.js";import{t as h}from"./auth-BtSAcF4e.js";var g={class:`login-container`},_={class:`login-card`},v=d(o({__name:`LoginView`,setup(n){let o=a(),d=h(),v=e(!1),y=l({email:``,password:``});async function b(){v.value=!0;try{let e=await d.login(y.email,y.password);e.success?(s.success(`登录成功`),o.push(`/`)):s.error(e.message||`登录失败`)}catch(e){s.error(e.response?.data?.message||`登录失败`)}finally{v.value=!1}}return(e,n)=>{let a=p(`el-input`),o=p(`el-form-item`),s=p(`el-button`),l=p(`el-form`);return r(),i(`div`,g,[u(`div`,_,[n[3]||=u(`div`,{class:`login-header`},[u(`h1`,null,`📊 书签管理后台`),u(`p`,null,`管理员登录`)],-1),m(l,{ref:`formRef`,model:y,class:`login-form`,onSubmit:c(b,[`prevent`])},{default:t(()=>[m(o,null,{default:t(()=>[m(a,{modelValue:y.email,"onUpdate:modelValue":n[0]||=e=>y.email=e,placeholder:`管理员邮箱`,size:`large`,"prefix-icon":`User`},null,8,[`modelValue`])]),_:1}),m(o,null,{default:t(()=>[m(a,{modelValue:y.password,"onUpdate:modelValue":n[1]||=e=>y.password=e,type:`password`,placeholder:`密码`,size:`large`,"show-password":``,"prefix-icon":`Lock`},null,8,[`modelValue`])]),_:1}),m(o,null,{default:t(()=>[m(s,{type:`primary`,size:`large`,loading:v.value,class:`submit-btn`,"native-type":`submit`},{default:t(()=>[...n[2]||=[f(` 登录 `,-1)]]),_:1},8,[`loading`])]),_:1})]),_:1},8,[`model`])])])}}}),[[`__scopeId`,`data-v-76df69c7`]]);export{v as default};