import{_ as e,by as a,u as s,r,b as o,q as l,d as t,e as n,h as i,f as d,k as p,g as u,aM as c,n as m,am as f,an as g,t as v,v as _,er as k,es as b,E as h}from"./index.286e9b79.js";import{E as y,a as j}from"./form.ad10dcd5.js";import"./form-item.9355e6dc.js";import{E as w}from"./input.31de1b37.js";import{g as x,p as V}from"./http.f588794f.js";import"./_initCloneObject.fb8fbaea.js";import"./event.776e7e11.js";import"./index.ed3ed02e.js";const q=e=>(v("data-v-81f46d00"),e=e(),_(),e),z={class:"login"},E={class:"content"},U={class:"login-wrap"},C=q((()=>i("div",{class:"l"},null,-1))),T={class:"r"},F=q((()=>i("div",{class:"title"},"欢 迎 登 陆",-1))),I={class:"form"},K={class:"footer"},L={class:"footer-wrap"},M={class:"record"},O={key:0},R={target:"_blank",href:"https://beian.miit.gov.cn/"},A={key:1},B={class:"security"},D=["href"],G={key:2},H={key:3},J=e({__name:"index",setup(e){const v=a(),_=s(),q=r({icp:"",operate:"",gov_record:"",gov_link:"",supervision_url:""});x("login/index").then((e=>{J.value=!1,e.code&&(q.value=e.data)}));let J=r(!1);const N=r(),P=o({username:[{required:!0,message:"请输入帐号",trigger:"blur"}],password:[{required:!0,message:"请输入密码",trigger:"blur"}]}),Q=o({username:"",password:""}),S=async e=>{e&&await e.validate(((e,a)=>{e&&(J.value=!0,V("login/index",Q).then((e=>{J.value=!1,e.code?(k(),v.removeToken(),b("users",{username:e.data.username}),v.setToken(e.data.token),h.success("登录成功"),_.replace("/")):h.error(e.msg)})))}))};return(e,a)=>{const s=w,r=y,o=l,v=j;return t(),n("div",z,[i("div",E,[i("div",U,[C,i("div",T,[F,i("div",I,[d(v,{model:u(Q),rules:u(P),ref_key:"ruleFormRef",ref:N,onKeyup:a[3]||(a[3]=c((e=>S(u(N))),["enter"]))},{default:p((()=>[d(r,{prop:"username"},{default:p((()=>[d(s,{type:"text",size:"large",modelValue:u(Q).username,"onUpdate:modelValue":a[0]||(a[0]=e=>u(Q).username=e),class:"form-input",placeholder:"请输入帐号","prefix-icon":"User"},null,8,["modelValue"])])),_:1}),d(r,{prop:"password"},{default:p((()=>[d(s,{type:"password",size:"large",modelValue:u(Q).password,"onUpdate:modelValue":a[1]||(a[1]=e=>u(Q).password=e),class:"form-input",placeholder:"请输入密码","prefix-icon":"Lock"},null,8,["modelValue"])])),_:1}),d(r,null,{default:p((()=>[d(o,{class:"form-button",color:"#2873eb",size:"large",type:"primary",loading:u(J),onClick:a[2]||(a[2]=e=>S(u(N)))},{default:p((()=>[m("登录")])),_:1},8,["loading"])])),_:1})])),_:1},8,["model","rules"])])])])]),i("div",K,[i("div",L,[i("div",M,[u(q).icp.length>0?(t(),n("span",O,[m("备案信息："),i("a",R,f(u(q).icp),1)])):g("",!0),u(q).gov_record.length>0?(t(),n("span",A,[m("公安备案："),i("i",B,[i("a",{target:"_blank",href:u(q).gov_link},f(u(q).gov_record),9,D)])])):g("",!0),u(q).operate.length>0?(t(),n("span",G,f(u(q).operate),1)):g("",!0),u(q).supervision_url.length>0?(t(),n("span",H,f(u(q).supervision_url),1)):g("",!0)])])])])}}},[["__scopeId","data-v-81f46d00"]]);export{J as default};
