text: (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[12],{"B+Dq":function(e,t,a){"use strict";var n=a("284h"),l=a("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a("14J3");var r=l(a("BMrR"));a("+L6B");var u=l(a("2/Rp"));a("jCWc");var o=l(a("kPKH"));a("5NDa");var i=l(a("5rEg")),s=l(a("pVnL")),d=l(a("QILm")),c=l(a("lwsE")),f=l(a("W8MJ")),p=l(a("a1gu")),m=l(a("Nsbk")),g=l(a("7W2i"));a("y8nQ");var h=l(a("Vl3Y")),v=n(a("q1tI")),b=l(a("BGR+")),y=l(a("JAxp")),E=l(a("dQek")),C=l(a("s+z6")),w=h.default.Item,M=function(e){function t(e){var a;return(0,c.default)(this,t),a=(0,p.default)(this,(0,m.default)(t).call(this,e)),a.onGetCaptcha=function(){var e=a.props.onGetCaptcha,t=e?e():null;!1!==t&&(t instanceof Promise?t.then(a.runGetCaptchaCountDown):a.runGetCaptchaCountDown())},a.getFormItemOptions=function(e){var t=e.onChange,a=e.defaultValue,n=e.customprops,l=e.rules,r={rules:l||n.rules};return t&&(r.onChange=t),a&&(r.initialValue=a),r},a.runGetCaptchaCountDown=function(){var e=a.props.countDown,t=e||59;a.setState({count:t}),a.interval=setInterval(function(){t-=1,a.setState({count:t}),0===t&&clearInterval(a.interval)},1e3)},a.state={count:0},a}return(0,g.default)(t,e),(0,f.default)(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.updateActive,a=e.name;t&&t(a)}},{key:"componentWillUnmount",value:function(){clearInterval(this.interval)}},{key:"render",value:function(){var e=this.state.count,t=this.props.form.getFieldDecorator,a=this.props,n=(a.onChange,a.customprops),l=(a.defaultValue,a.rules,a.name),c=a.buttonText,f=(a.updateActive,a.type),p=(0,d.default)(a,["onChange","customprops","defaultValue","rules","name","buttonText","updateActive","type"]),m=this.getFormItemOptions(this.props),g=p||{};if("Captcha"===f){var h=(0,b.default)(g,["onGetCaptcha","countDown"]);return v.default.createElement(w,null,v.default.createElement(r.default,{gutter:8},v.default.createElement(o.default,{span:16},t(l,m)(v.default.createElement(i.default,(0,s.default)({},n,h)))),v.default.createElement(o.default,{span:8},v.default.createElement(u.default,{disabled:e,className:y.default.getCaptcha,size:"large",onClick:this.onGetCaptcha},e?"".concat(e," s"):c))))}return v.default.createElement(w,null,t(l,m)(v.default.createElement(i.default,(0,s.default)({},n,g))))}}]),t}(v.Component);M.defaultProps={buttonText:"\u83b7\u53d6\u9a8c\u8bc1\u7801"};var x={};Object.keys(E.default).forEach(function(e){var t=E.default[e];x[e]=function(a){return v.default.createElement(C.default.Consumer,null,function(n){return v.default.createElement(M,(0,s.default)({customprops:t.props,rules:t.rules},a,{type:e,updateActive:n.updateActive,form:n.form}))})}});var N=x;t.default=N},JAxp:function(e,t,a){e.exports={login:"antd-pro-components-login-index-login",icon:"antd-pro-components-login-index-icon",other:"antd-pro-components-login-index-other",register:"antd-pro-components-login-index-register",prefixIcon:"antd-pro-components-login-index-prefixIcon",submit:"antd-pro-components-login-index-submit"}},"M+k9":function(e,t,a){"use strict";var n=a("284h"),l=a("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=l(a("pVnL")),u=l(a("lwsE")),o=l(a("W8MJ")),i=l(a("a1gu")),s=l(a("Nsbk")),d=l(a("7W2i"));a("Znn+");var c=l(a("ZTPi")),f=n(a("q1tI")),p=l(a("s+z6")),m=c.default.TabPane,g=function(){var e=0;return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e+=1,"".concat(t).concat(e)}}(),h=function(e){function t(e){var a;return(0,u.default)(this,t),a=(0,i.default)(this,(0,s.default)(t).call(this,e)),a.uniqueId=g("login-tab-"),a}return(0,d.default)(t,e),(0,o.default)(t,[{key:"componentDidMount",value:function(){var e=this.props.tabUtil;e.addTab(this.uniqueId)}},{key:"render",value:function(){var e=this.props.children;return f.default.createElement(m,this.props,e)}}]),t}(f.Component),v=function(e){return f.default.createElement(p.default.Consumer,null,function(t){return f.default.createElement(h,(0,r.default)({tabUtil:t.tabUtil},e))})};v.typeName="LoginTab";var b=v;t.default=b},QBZU:function(e,t,a){"use strict";var n=a("284h"),l=a("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a("y8nQ");var r=l(a("Vl3Y"));a("Znn+");var u=l(a("ZTPi")),o=l(a("RIqP")),i=l(a("lwsE")),s=l(a("W8MJ")),d=l(a("a1gu")),c=l(a("Nsbk")),f=l(a("7W2i")),p=n(a("q1tI")),m=(l(a("17x9")),l(a("TSYQ"))),g=l(a("B+Dq")),h=l(a("M+k9")),v=l(a("Yrmy")),b=l(a("JAxp")),y=l(a("s+z6")),E=function(e){function t(e){var a;return(0,i.default)(this,t),a=(0,d.default)(this,(0,c.default)(t).call(this,e)),a.onSwitch=function(e){a.setState({type:e});var t=a.props.onTabChange;t(e)},a.getContext=function(){var e=a.state.tabs,t=a.props.form;return{tabUtil:{addTab:function(t){a.setState({tabs:(0,o.default)(e).concat([t])})},removeTab:function(t){a.setState({tabs:e.filter(function(e){return e!==t})})}},form:t,updateActive:function(e){var t=a.state,n=t.type,l=t.active;l[n]?l[n].push(e):l[n]=[e],a.setState({active:l})}}},a.handleSubmit=function(e){e.preventDefault();var t=a.state,n=t.active,l=t.type,r=a.props,u=r.form,o=r.onSubmit,i=n[l];u.validateFields(i,{force:!0},function(e,t){o(e,t)})},a.state={type:e.defaultActiveKey,tabs:[],active:{}},a}return(0,f.default)(t,e),(0,s.default)(t,[{key:"render",value:function(){var e=this.props,t=e.className,a=e.children,n=this.state,l=n.type,i=n.tabs,s=[],d=[];return p.default.Children.forEach(a,function(e){e&&("LoginTab"===e.type.typeName?s.push(e):d.push(e))}),p.default.createElement(y.default.Provider,{value:this.getContext()},p.default.createElement("div",{className:(0,m.default)(t,b.default.login)},p.default.createElement(r.default,{onSubmit:this.handleSubmit},i.length?p.default.createElement(p.default.Fragment,null,p.default.createElement(u.default,{animated:!1,className:b.default.tabs,activeKey:l,onChange:this.onSwitch},s),d):(0,o.default)(a))))}}]),t}(p.Component);E.defaultProps={className:"",defaultActiveKey:"",onTabChange:function(){},onSubmit:function(){}},E.Tab=h.default,E.Submit=v.default,Object.keys(g.default).forEach(function(e){E[e]=g.default[e]});var C=r.default.create()(E);t.default=C},Y5yc:function(e,t,a){"use strict";var n=a("TqRt"),l=a("284h");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a("Pwec");var r=n(a("CtXQ"));a("sRBo");var u=n(a("kaz8"));a("fOrg");var o,i,s=n(a("+KLJ")),d=n(a("MVZn")),c=n(a("lwsE")),f=n(a("W8MJ")),p=n(a("a1gu")),m=n(a("Nsbk")),g=n(a("7W2i")),h=l(a("q1tI")),v=a("MuoO"),b=a("LLXN"),y=n(a("mOP9")),E=n(a("QBZU")),C=n(a("w2qy")),w=E.default.Tab,M=E.default.UserName,x=E.default.Password,N=E.default.Mobile,k=E.default.Captcha,P=E.default.Submit,T=(o=(0,v.connect)(function(e){var t=e.login,a=e.loading;return{login:t,submitting:a.effects["login/login"]}}),o(i=function(e){function t(){var e,a;(0,c.default)(this,t);for(var n=arguments.length,l=new Array(n),r=0;r<n;r++)l[r]=arguments[r];return a=(0,p.default)(this,(e=(0,m.default)(t)).call.apply(e,[this].concat(l))),a.state={type:"account",autoLogin:!0},a.onTabChange=function(e){a.setState({type:e})},a.onGetCaptcha=function(){return new Promise(function(e,t){a.loginForm.validateFields(["mobile"],{},function(n,l){if(n)t(n);else{var r=a.props.dispatch;r({type:"login/getCaptcha",payload:l.mobile}).then(e).catch(t)}})})},a.handleSubmit=function(e,t){var n=a.state.type;if(!e){var l=a.props.dispatch;l({type:"login/login",payload:(0,d.default)({},t,{type:n})})}},a.changeAutoLogin=function(e){a.setState({autoLogin:e.target.checked})},a.renderMessage=function(e){return h.default.createElement(s.default,{style:{marginBottom:24},message:e,type:"error",showIcon:!0})},a}return(0,g.default)(t,e),(0,f.default)(t,[{key:"render",value:function(){var e=this,t=this.props,a=t.login,n=t.submitting,l=this.state,o=l.type,i=l.autoLogin;return h.default.createElement("div",{className:C.default.main},h.default.createElement(E.default,{defaultActiveKey:o,onTabChange:this.onTabChange,onSubmit:this.handleSubmit,ref:function(t){e.loginForm=t}},h.default.createElement(w,{key:"account",tab:(0,b.formatMessage)({id:"app.login.tab-login-credentials"})},"error"===a.status&&"account"===a.type&&!n&&this.renderMessage((0,b.formatMessage)({id:"app.login.message-invalid-credentials"})),h.default.createElement(M,{name:"userName",placeholder:"username: admin or user"}),h.default.createElement(x,{name:"password",placeholder:"password: ant.design",onPressEnter:function(){return e.loginForm.validateFields(e.handleSubmit)}})),h.default.createElement(w,{key:"mobile",tab:(0,b.formatMessage)({id:"app.login.tab-login-mobile"})},"error"===a.status&&"mobile"===a.type&&!n&&this.renderMessage((0,b.formatMessage)({id:"app.login.message-invalid-verification-code"})),h.default.createElement(N,{name:"mobile"}),h.default.createElement(k,{name:"captcha",countDown:120,onGetCaptcha:this.onGetCaptcha})),h.default.createElement("div",null,h.default.createElement(u.default,{checked:i,onChange:this.changeAutoLogin},h.default.createElement(b.FormattedMessage,{id:"app.login.remember-me"})),h.default.createElement("a",{style:{float:"right"},href:""},h.default.createElement(b.FormattedMessage,{id:"app.login.forgot-password"}))),h.default.createElement(P,{loading:n},h.default.createElement(b.FormattedMessage,{id:"app.login.login"})),h.default.createElement("div",{className:C.default.other},h.default.createElement(b.FormattedMessage,{id:"app.login.sign-in-with"}),h.default.createElement(r.default,{type:"alipay-circle",className:C.default.icon,theme:"outlined"}),h.default.createElement(r.default,{type:"taobao-circle",className:C.default.icon,theme:"outlined"}),h.default.createElement(r.default,{type:"weibo-circle",className:C.default.icon,theme:"outlined"}),h.default.createElement(y.default,{className:C.default.register,to:"/User/Register"},h.default.createElement(b.FormattedMessage,{id:"app.login.signup"})))))}}]),t}(h.Component))||i),I=T;t.default=I},Yrmy:function(e,t,a){"use strict";var n=a("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a("+L6B");var l=n(a("2/Rp")),r=n(a("pVnL")),u=n(a("QILm"));a("y8nQ");var o=n(a("Vl3Y")),i=n(a("q1tI")),s=n(a("TSYQ")),d=n(a("JAxp")),c=o.default.Item,f=function(e){var t=e.className,a=(0,u.default)(e,["className"]),n=(0,s.default)(d.default.submit,t);return i.default.createElement(c,null,i.default.createElement(l.default,(0,r.default)({size:"large",className:n,type:"primary",htmlType:"submit"},a)))},p=f;t.default=p},dQek:function(e,t,a){"use strict";var n=a("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a("Pwec");var l=n(a("CtXQ")),r=n(a("q1tI")),u=n(a("JAxp")),o={UserName:{props:{size:"large",id:"userName",prefix:r.default.createElement(l.default,{type:"user",className:u.default.prefixIcon}),placeholder:"admin"},rules:[{required:!0,message:"Please enter username!"}]},Password:{props:{size:"large",prefix:r.default.createElement(l.default,{type:"lock",className:u.default.prefixIcon}),type:"password",id:"password",placeholder:"888888"},rules:[{required:!0,message:"Please enter password!"}]},Mobile:{props:{size:"large",prefix:r.default.createElement(l.default,{type:"mobile",className:u.default.prefixIcon}),placeholder:"mobile number"},rules:[{required:!0,message:"Please enter mobile number!"},{pattern:/^1\d{10}$/,message:"Wrong mobile number format!"}]},Captcha:{props:{size:"large",prefix:r.default.createElement(l.default,{type:"mail",className:u.default.prefixIcon}),placeholder:"captcha"},rules:[{required:!0,message:"Please enter Captcha!"}]}};t.default=o},"s+z6":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=a("q1tI"),l=(0,n.createContext)(),r=l;t.default=r},w2qy:function(e,t,a){e.exports={main:"antd-pro-pages-user-login-main",icon:"antd-pro-pages-user-login-icon",other:"antd-pro-pages-user-login-other",register:"antd-pro-pages-user-login-register"}}}]);