import{s as c,o as f}from"./baseUrl-C_rSP_rE.js";import{e as g,M as h,h as w,K as e,F as t,u as a,aA as _,as as x,aj as V,ak as d,aB as k,aC as y,f as T,ar as b,at as n,ag as i,ac as v,a5 as C,aD as B}from"./index-D6Xt1sgO.js";import{u as A}from"./index-BrqL7JM9.js";const F=u=>c.post({url:f+"/admin/login",data:u}),q={class:"w-full h-full relative overflow-hidden"},N=g({__name:"index",setup(u){const m=x();B();const l=h({username:"",password:""});async function p(){try{V({message:"登录中...",forbidClick:!0});const{code:o,data:s}=await F(l);d(),o==0&&(["264","132"].includes(String(s.id))?(y(s.token),m.push("/home")):k({message:"账号存在,但该账号不能使用本系统",duration:2e3}))}catch(o){console.log(o),d()}}return A("登录"),(o,s)=>(T(),w("div",q,[e(a(_),{class:"max-w-[95%] w-[400px] fixed top-[300px] left-[50%]",style:{transform:"translate(-50%, -50%)"},onSubmit:p},{default:t(()=>[e(a(b),null,{default:t(()=>[e(a(n),null,{default:t(()=>[e(a(i),{modelValue:l.username,"onUpdate:modelValue":s[0]||(s[0]=r=>l.username=r),label:"手机号",placeholder:"请输入手机号",maxlength:"11",rules:[{required:!0,message:"请填写手机号",trigger:"change"}]},null,8,["modelValue"])]),_:1}),e(a(n),null,{default:t(()=>[e(a(i),{modelValue:l.password,"onUpdate:modelValue":s[1]||(s[1]=r=>l.password=r),label:"密码",placeholder:"请输入密码",type:"password",rules:[{required:!0,message:"请填写用户名",trigger:"change"}]},null,8,["modelValue"])]),_:1}),e(a(n),{class:"mt-[16px]"},{default:t(()=>[e(a(v),{block:"",type:"primary","native-type":"submit"},{default:t(()=>[C("登录")]),_:1})]),_:1})]),_:1})]),_:1})]))}});export{N as default};
