Index-9e28691b.js 3.2 KB

1
  1. import{c as a,A as h,a1 as w,d as y,a as x,v as L,r as u,o as S,y as C,w as l,f as I,e as A,C as P,D as j}from"./index-bed2942a.js";import{i as B}from"./index-d139c558.js";var N={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M521.7 82c-152.5-.4-286.7 78.5-363.4 197.7-3.4 5.3.4 12.3 6.7 12.3h70.3c4.8 0 9.3-2.1 12.3-5.8 7-8.5 14.5-16.7 22.4-24.5 32.6-32.5 70.5-58.1 112.7-75.9 43.6-18.4 90-27.8 137.9-27.8 47.9 0 94.3 9.3 137.9 27.8 42.2 17.8 80.1 43.4 112.7 75.9 32.6 32.5 58.1 70.4 76 112.5C865.7 417.8 875 464.1 875 512c0 47.9-9.4 94.2-27.8 137.8-17.8 42.1-43.4 80-76 112.5s-70.5 58.1-112.7 75.9A352.8 352.8 0 01520.6 866c-47.9 0-94.3-9.4-137.9-27.8A353.84 353.84 0 01270 762.3c-7.9-7.9-15.3-16.1-22.4-24.5-3-3.7-7.6-5.8-12.3-5.8H165c-6.3 0-10.2 7-6.7 12.3C234.9 863.2 368.5 942 520.6 942c236.2 0 428-190.1 430.4-425.6C953.4 277.1 761.3 82.6 521.7 82zM395.02 624v-76h-314c-4.4 0-8-3.6-8-8v-56c0-4.4 3.6-8 8-8h314v-76c0-6.7 7.8-10.5 13-6.3l141.9 112a8 8 0 010 12.6l-141.9 112c-5.2 4.1-13 .4-13-6.3z"}}]},name:"login",theme:"outlined"};const k=N;function m(o){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?Object(arguments[e]):{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){z(o,i,t[i])})}return o}function z(o,e,t){return e in o?Object.defineProperty(o,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):o[e]=t,o}var f=function(e,t){var n=m({},e,t.attrs);return a(h,m({},n,{icon:k}),null)};f.displayName="LoginOutlined";f.inheritAttrs=!1;const F=f,U=w("userInfo",{state:()=>({username:"",isLogin:!1}),persist:{enabled:!0,strategies:[{key:"userInfo",storage:sessionStorage}]}}),V={style:{"text-align":"center"}},E=y({__name:"Index",setup(o){const e=x(),t=U(),n=L({username:"",password:""}),i=c=>{console.log(c),B.post("/login",c).then(r=>{const{code:p,data:s}=r.data;if(console.log(p,s),p==0){t.isLogin=!0,t.username=s.username,e.replace("/");return}j.error(s)},r=>{console.log("failed",r)})},g=c=>{console.log(c)};return(c,r)=>{const p=u("a-input"),s=u("a-form-item"),_=u("a-input-password"),v=u("a-button"),b=u("a-form"),O=u("a-result");return S(),C("div",null,[a(O,{status:"info",title:"请登录"},{icon:l(()=>[a(I(F))]),extra:l(()=>[A("div",V,[a(b,{style:{width:"400px",display:"inline-block"},model:n,name:"basic","label-align":"left","label-col":{span:4},"wrapper-col":{span:20},autocomplete:"off",onFinish:i,onFinishFailed:g},{default:l(()=>[a(s,{label:"账号",name:"username",rules:[{required:!0,message:"请输入账号!"}]},{default:l(()=>[a(p,{value:n.username,"onUpdate:value":r[0]||(r[0]=d=>n.username=d)},null,8,["value"])]),_:1}),a(s,{label:"密码",name:"password",rules:[{required:!0,message:"请输入密码!"}]},{default:l(()=>[a(_,{value:n.password,"onUpdate:value":r[1]||(r[1]=d=>n.password=d)},null,8,["value"])]),_:1}),a(s,{"wrapper-col":{offset:0,span:24}},{default:l(()=>[a(v,{size:"large",block:"",type:"primary","html-type":"submit"},{default:l(()=>[P("登录")]),_:1})]),_:1})]),_:1},8,["model"])])]),_:1})])}}});export{E as default};