"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[366],{2067:function(z,g,e){e.r(g);var v=e(15009),l=e.n(v),P=e(99289),c=e.n(P),A=e(5574),D=e.n(A),O=e(65631),p=e(27203),y=e(87547),j=e(94149),I=e(68262),h=e(5966),d=e(76772),f=e(2453),b=e(11941),L=e(75463),T=e(67294),s=e(85893),C=(0,L.kc)(function(E){var i=E.token;return{action:{marginLeft:"8px",color:"rgba(0, 0, 0, 0.2)",fontSize:"24px",verticalAlign:"middle",cursor:"pointer",transition:"color 0.3s","&:hover":{color:i.colorPrimaryActive}},lang:{width:42,height:42,lineHeight:"42px",position:"fixed",right:16,borderRadius:i.borderRadius,":hover":{backgroundColor:i.colorBgTextHover}},container:{display:"flex",flexDirection:"column",height:"100vh",overflow:"auto",backgroundImage:"url('https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/V-_oS6r-i7wAAAAAAAAAAAAAFl94AQBr')",backgroundSize:"100% 100%"}}}),R=function(){var i=(0,T.useState)("account"),M=D()(i,2),U=M[0],B=M[1],W=C(),K=W.styles,m=(0,d.useIntl)(),x=function(){var u=c()(l()().mark(function t(r){var n;return l()().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return _.next=2,(0,p.n)(r);case 2:return n=_.sent.data,_.abrupt("return",n);case 4:case"end":return _.stop()}},t)}));return function(r){return u.apply(this,arguments)}}(),S=function(){var u=c()(l()().mark(function t(r){var n,o,_;return l()().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,console.log("handleSubmit"),a.next=4,x(r);case 4:return a.next=6,(0,p.n)(r);case 6:if(n=a.sent,console.log("msg",n),!n){a.next=17;break}return o=m.formatMessage({id:"pages.login.success",defaultMessage:"\u767B\u5F55\u6210\u529F\uFF01"}),f.ZP.success(o),localStorage.setItem("account",r.account),localStorage.setItem("password",r.password),localStorage.setItem("token",n.data.token),localStorage.setItem("id",n.data.id),d.history.push("/org"),a.abrupt("return");case 17:console.log(n),a.next=25;break;case 20:a.prev=20,a.t0=a.catch(0),_=m.formatMessage({id:"pages.login.failure",defaultMessage:"\u767B\u5F55\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\uFF01"}),console.log(a.t0),f.ZP.error(_);case 25:case"end":return a.stop()}},t,null,[[0,20]])}));return function(r){return u.apply(this,arguments)}}();return(0,s.jsxs)("div",{className:K.container,children:[(0,s.jsx)("div",{style:{flex:"1",padding:"32px 0"},children:(0,s.jsxs)(I.U,{contentStyle:{minWidth:280,maxWidth:"75vw"},title:"CrazyCharge admin",subTitle:"The best charge station of the word",initialValues:{autoLogin:!0},onFinish:function(){var u=c()(l()().mark(function t(r){return l()().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,S(r);case 2:case"end":return o.stop()}},t)}));return function(t){return u.apply(this,arguments)}}(),children:[(0,s.jsx)(b.Z,{activeKey:U,onChange:B,centered:!0,items:[{key:"account",label:m.formatMessage({id:"pages.login.accountLogin.tab",defaultMessage:"Account Login "})}]}),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(h.Z,{name:"account",fieldProps:{size:"large",prefix:(0,s.jsx)(y.Z,{})},placeholder:"admin",rules:[{required:!0,message:(0,s.jsx)(d.FormattedMessage,{id:"pages.login.username.required",defaultMessage:"Account is required"})}]}),(0,s.jsx)(h.Z.Password,{name:"password",fieldProps:{size:"large",prefix:(0,s.jsx)(j.Z,{})},placeholder:"admin",rules:[{required:!0,message:(0,s.jsx)(d.FormattedMessage,{id:"pages.login.password.required",defaultMessage:"Please input password"})}]})]})]})}),(0,s.jsx)(O.$,{})]})};g.default=R}}]);
