import{s as c,o as f}from"./baseUrl-DBpYTmy_.js";import{d as g,a as w,c as h,b as e,w as l,u as a,Q as _,A as x,m as V,n as d,R as b,U as y,o as T,C as k,E as n,j as i,B as v,h as C,V as B}from"./index-b3EL4gLd.js";import{u as A}from"./index-CI-53yI5.js";const U=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 t=w({username:"",password:""});async function p(){try{V({message:"登录中...",forbidClick:!0});const{code:o,data:s}=await U(t);d(),o==0&&(["264","132"].includes(String(s.id))?(y(s.token),m.push("/home")):b({message:"账号存在,但该账号不能使用本系统",duration:2e3}))}catch(o){console.log(o),d()}}return A("登录"),(o,s)=>(T(),h("div",q,[e(a(_),{class:"max-w-[95%] w-[400px] fixed top-[300px] left-[50%]",style:{transform:"translate(-50%, -50%)"},onSubmit:p},{default:l(()=>[e(a(k),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};
