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