Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

1 рік тому
1
  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[4053],{5966:function(ae,N,e){"use strict";var j=e(28991),y=e(81253),B=e(85893),g=e(31649),F=["fieldProps","proFieldProps"],K=["fieldProps","proFieldProps"],n="text",L=function(E){var k=E.fieldProps,P=E.proFieldProps,re=(0,y.Z)(E,F);return(0,B.jsx)(g.Z,(0,j.Z)({valueType:n,fieldProps:k,filedConfig:{valueType:n},proFieldProps:P},re))},ce=function(E){var k=E.fieldProps,P=E.proFieldProps,re=(0,y.Z)(E,K);return(0,B.jsx)(g.Z,(0,j.Z)({valueType:"password",fieldProps:k,proFieldProps:P,filedConfig:{valueType:n}},re))},J=L;J.Password=ce,J.displayName="ProFormComponent",N.Z=J},42081:function(ae){ae.exports={container:"container___2XU-J",lang:"lang___3UZBu",content:"content___232he",top:"top___2e5qd",header:"header___1G_uO",logo:"logo___2RIUt",title:"title___3xYCK",desc:"desc___1GQtf",main:"main___oMoRI",icon:"icon___1dSHb",other:"other___3ljbI",register:"register___1vN_i",prefixIcon:"prefixIcon___57iuX"}},44943:function(){},43674:function(ae,N,e){"use strict";e.r(N),e.d(N,{default:function(){return de}});var j=e(18106),y=e(60561),B=e(34792),g=e(48086),F=e(39428),K=e(11849),n=e(3182),L=e(2824),ce=e(17462),J=e(76772),te=e(89366),E=e(2603),k=e(80521),P=e(67294),re=e(57663),ve=e(71577),Pe=e(47673),ge=e(4107),H=e(28991),ne=e(55507),fe=e(92137),me=e(81253),V=e(28481),ye=e(9715),he=e(71257),r=e(85893),pe=e(64893),xe=["rules","name","phoneName","fieldProps","captchaTextRender","captchaProps"],se=P.forwardRef(function(p,T){var M=he.Z.useFormInstance(),z=(0,P.useState)(p.countDown||60),W=(0,V.Z)(z,2),w=W[0],Q=W[1],$=(0,P.useState)(!1),O=(0,V.Z)($,2),m=O[0],R=O[1],D=(0,P.useState)(),_=(0,V.Z)(D,2),G=_[0],x=_[1],b=p.rules,Z=p.name,X=p.phoneName,Y=p.fieldProps,f=p.captchaTextRender,ee=f===void 0?function(o,C){return o?"".concat(C," \u79D2\u540E\u91CD\u65B0\u83B7\u53D6"):"\u83B7\u53D6\u9A8C\u8BC1\u7801"}:f,S=p.captchaProps,v=(0,me.Z)(p,xe),c=function(){var o=(0,fe.Z)((0,ne.Z)().mark(function C(u){return(0,ne.Z)().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return I.prev=0,x(!0),I.next=4,v.onGetCaptcha(u);case 4:x(!1),R(!0),I.next=13;break;case 8:I.prev=8,I.t0=I.catch(0),R(!1),x(!1),console.log(I.t0);case 13:case"end":return I.stop()}},C,null,[[0,8]])}));return function(u){return o.apply(this,arguments)}}();return(0,P.useImperativeHandle)(T,function(){return{startTiming:function(){return R(!0)},endTiming:function(){return R(!1)}}}),(0,P.useEffect)(function(){var o=0,C=p.countDown;return m&&(o=window.setInterval(function(){Q(function(u){return u<=1?(R(!1),clearInterval(o),C||60):u-1})},1e3)),function(){return clearInterval(o)}},[m]),(0,r.jsxs)("div",{style:(0,H.Z)((0,H.Z)({},Y==null?void 0:Y.style),{},{display:"flex",alignItems:"center"}),ref:T,children:[(0,r.jsx)(ge.Z,(0,H.Z)((0,H.Z)({},Y),{},{style:{flex:1,transition:"width .3s",marginRight:8}})),(0,r.jsx)(ve.Z,(0,H.Z)((0,H.Z)({style:{display:"block"},disabled:m,loading:G},S),{},{onClick:function(){var o=(0,fe.Z)((0,ne.Z)().mark(function u(){var oe;return(0,ne.Z)().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(l.prev=0,!X){l.next=9;break}return l.next=4,M.validateFields([X].flat(1));case 4:return oe=M.getFieldValue([X].flat(1)),l.next=7,c(oe);case 7:l.next=11;break;case 9:return l.next=11,c("");case 11:l.next=16;break;case 13:l.prev=13,l.t0=l.catch(0),console.log(l.t0);case 16:case"end":return l.stop()}},u,null,[[0,13]])}));function C(){return o.apply(this,arguments)}return C}(),children:ee(m,w)}))]})}),Ce=(0,pe.G)(se),t=Ce,i=e(952),d=e(5966),a=e(48971),s=e(73727),le=e(92002),A=e(64172),q=e(42081),h=e.n(q),U=function(T){var M=T.content;return(0,r.jsx)(J.Z,{style:{marginBottom:24},message:M,type:"error",showIcon:!0})},ie=function(){var T=a.m8.location.query,M=T.redirect;window.location.href="/"},ue=function(){var T=(0,P.useState)(!1),M=(0,L.Z)(T,2),z=M[0],W=M[1],w=(0,P.useState)({}),Q=(0,L.Z)(w,2),$=Q[0],O=Q[1],m=(0,P.useState)("account"),R=(0,L.Z)(m,2),D=R[0],_=R[1],G=(0,a.tT)("@@initialState"),x=G.initialState,b=G.setInitialState,Z=(0,a.YB)(),X=function(){var S=(0,n.Z)((0,F.Z)().mark(function v(){var c,o;return(0,F.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,x==null||(c=x.fetchUserInfo)===null||c===void 0?void 0:c.call(x);case 2:o=u.sent,o&&b((0,K.Z)((0,K.Z)({},x),{},{currentUser:o}));case 4:case"end":return u.stop()}},v)}));return function(){return S.apply(this,arguments)}}(),Y=function(){var S=(0,n.Z)((0,F.Z)().mark(function v(c){var o,C,u,oe;return(0,F.Z)().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return W(!0),l.prev=1,localStorage.clear(),l.next=5,A.Z.Login((0,K.Z)((0,K.Z)({},c),{},{type:D}));case 5:if(o=l.sent,o.statusCode!==200){l.next=17;break}return localStorage.setItem("userid",o.data.userID),localStorage.setItem("token",o.data.token),C=Z.formatMessage({id:"pages.login.success",defaultMessage:"\u767B\u5F55\u6210\u529F\uFF01"}),g.default.success(C),l.next=13,X();case 13:return ie(),l.abrupt("return");case 17:o.succeeded?(u=Z.formatMessage({id:"pages.login.accountLogin.tab",defaultMessage:"\u8D26\u53F7\u5BC6\u7801\u9519\u8BEF\uFF01"}),g.default.error(u)):g.default.error(o.errors);case 18:l.next=25;break;case 20:l.prev=20,l.t0=l.catch(1),console.log("fdsafds",l.t0),oe=Z.formatMessage({id:"pages.login.failure",defaultMessage:"\u767B\u5F55\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\uFF01"}),g.default.error(oe);case 25:W(!1);case 26:case"end":return l.stop()}},v,null,[[1,20]])}));return function(c){return S.apply(this,arguments)}}(),f=$.status,ee=$.type;return(0,r.jsx)("div",{className:h().container,children:(0,r.jsxs)("div",{className:h().content,children:[(0,r.jsx)("div",{className:h().top,children:(0,r.jsx)("div",{className:h().header,children:(0,r.jsxs)("div",{children:[(0,r.jsx)(s.rU,{to:"/",children:(0,r.jsx)("div",{children:(0,r.jsx)("img",{alt:"logo",className:h().logo,src:"/logo.png"})})}),(0,r.jsx)("div",{className:h().desc,children:"\u667A\u6167\u9910\u996E\u89E3\u51B3\u65B9\u6848\u670D\u52A1\u5546"})]})})}),(0,r.jsxs)("div",{className:h().main,children:[(0,r.jsx)("div",{className:h().title,children:"\u8FDE\u9501\u7ECF\u8425\u5E73\u53F0"}),(0,r.jsxs)(i.ZP,{initialValues:{autoLogin:!0},submitter:{searchConfig:{submitText:Z.formatMessage({id:"pages.login.submit",defaultMessage:"\u767B\u5F55"})},render:function(v,c){return c.pop()},submitButtonProps:{loading:z,size:"large",style:{width:"100%"}}},isKeyPressSubmit:!0,onFinish:function(){var S=(0,n.Z)((0,F.Z)().mark(function v(c){return(0,F.Z)().wrap(function(C){for(;;)switch(C.prev=C.next){case 0:Y(c);case 1:case"end":return C.stop()}},v)}));return function(v){return S.apply(this,arguments)}}(),children:[(0,r.jsx)(y.Z,{activeKey:D,onChange:_}),f==="error"&&ee==="account"&&(0,r.jsx)(U,{content:Z.formatMessage({id:"pages.login.accountLogin.errorMessage",defaultMessage:"\u8D26\u6237\u6216\u5BC6\u7801\u9519\u8BEF\uFF08admin/ant.design)"})}),D==="account"&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(d.Z,{name:"Account",fieldProps:{size:"large",prefix:(0,r.jsx)(te.Z,{className:h().prefixIcon})},placeholder:Z.formatMessage({id:"pages.login.username.placeholder",defaultMessage:"\u7528\u6237\u540D: admin or user"}),rules:[{required:!0,message:(0,r.jsx)(a._H,{id:"pages.login.username.required",defaultMessage:"\u8BF7\u8F93\u5165\u7528\u6237\u540D!"})}]}),(0,r.jsx)(d.Z.Password,{name:"Password",fieldProps:{size:"large",prefix:(0,r.jsx)(E.Z,{className:h().prefixIcon})},placeholder:Z.formatMessage({id:"pages.login.password.placeholder",defaultMessage:"\u5BC6\u7801: ant.design"}),rules:[{required:!0,message:(0,r.jsx)(a._H,{id:"pages.login.password.required",defaultMessage:"\u8BF7\u8F93\u5165\u5BC6\u7801\uFF01"})}]})]}),f==="error"&&ee==="mobile"&&(0,r.jsx)(U,{content:"\u9A8C\u8BC1\u7801\u9519\u8BEF"}),D==="mobile"&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(d.Z,{fieldProps:{size:"large",prefix:(0,r.jsx)(k.Z,{className:h().prefixIcon})},name:"mobile",placeholder:Z.formatMessage({id:"pages.login.phoneNumber.placeholder",defaultMessage:"\u624B\u673A\u53F7"}),rules:[{required:!0,message:(0,r.jsx)(a._H,{id:"pages.login.phoneNumber.required",defaultMessage:"\u8BF7\u8F93\u5165\u624B\u673A\u53F7\uFF01"})},{pattern:/^1\d{10}$/,message:(0,r.jsx)(a._H,{id:"pages.login.phoneNumber.invalid",defaultMessage:"\u624B\u673A\u53F7\u683C\u5F0F\u9519\u8BEF\uFF01"})}]}),(0,r.jsx)(t,{fieldProps:{size:"large",prefix:(0,r.jsx)(E.Z,{className:h().prefixIcon})},captchaProps:{size:"large"},placeholder:Z.formatMessage({id:"pages.login.captcha.placeholder",defaultMessage:"\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801"}),captchaTextRender:function(v,c){return v?"".concat(c," ").concat(Z.formatMessage({id:"pages.getCaptchaSecondText",defaultMessage:"\u83B7\u53D6\u9A8C\u8BC1\u7801"})):Z.formatMessage({id:"pages.login.phoneLogin.getVerificationCode",defaultMessage:"\u83B7\u53D6\u9A8C\u8BC1\u7801"})},name:"captcha",rules:[{required:!0,message:(0,r.jsx)(a._H,{id:"pages.login.captcha.required",defaultMessage:"\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801\uFF01"})}],onGetCaptcha:function(){var S=(0,n.Z)((0,F.Z)().mark(function v(c){var o;return(0,F.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,A.Z.getFakeCaptcha({phone:c});case 2:if(o=u.sent,o!==!1){u.next=5;break}return u.abrupt("return");case 5:g.default.success("\u83B7\u53D6\u9A8C\u8BC1\u7801\u6210\u529F\uFF01\u9A8C\u8BC1\u7801\u4E3A\uFF1A1234");case 6:case"end":return u.stop()}},v)}));return function(v){return S.apply(this,arguments)}}()})]})]})]})]})})},de=ue},5467:function(ae,N,e){"use strict";e.d(N,{Z:function(){return j}});function j(y){return Object.keys(y).reduce(function(B,g){return(g.startsWith("data-")||g.startsWith("aria-")||g==="role")&&!g.startsWith("data-__")&&(B[g]=y[g]),B},{})}},47933:function(ae,N,e){"use strict";e.d(N,{ZP:function(){return Ce}});var j=e(22122),y=e(96156),B=e(28481),g=e(94184),F=e.n(g),K=e(21770),n=e(67294),L=e(53124),ce=e(97647),J=e(5467),te=n.createContext(null),E=te.Provider,k=te,P=n.createContext(null),re=P.Provider,ve=e(50132),Pe=e(42550),ge=e(98866),H=e(65223),ne=function(t,i){var d={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&i.indexOf(a)<0&&(d[a]=t[a]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,a=Object.getOwnPropertySymbols(t);s<a.length;s++)i.indexOf(a[s])<0&&Object.prototype.propertyIsEnumerable.call(t,a[s])&&(d[a[s]]=t[a[s]]);return d},fe=function(i,d){var a,s=n.useContext(k),le=n.useContext(P),A=n.useContext(L.E_),q=A.getPrefixCls,h=A.direction,U=n.useRef(),ie=(0,Pe.sQ)(d,U),ue=(0,n.useContext)(H.aM),de=ue.isFormItemInput,p=function(G){var x,b;(x=i.onChange)===null||x===void 0||x.call(i,G),(b=s==null?void 0:s.onChange)===null||b===void 0||b.call(s,G)},T=i.prefixCls,M=i.className,z=i.children,W=i.style,w=i.disabled,Q=ne(i,["prefixCls","className","children","style","disabled"]),$=q("radio",T),O=((s==null?void 0:s.optionType)||le)==="button"?"".concat($,"-button"):$,m=(0,j.Z)({},Q),R=n.useContext(ge.Z);m.disabled=w||R,s&&(m.name=s.name,m.onChange=p,m.checked=i.value===s.value,m.disabled=m.disabled||s.disabled);var D=F()("".concat(O,"-wrapper"),(a={},(0,y.Z)(a,"".concat(O,"-wrapper-checked"),m.checked),(0,y.Z)(a,"".concat(O,"-wrapper-disabled"),m.disabled),(0,y.Z)(a,"".concat(O,"-wrapper-rtl"),h==="rtl"),(0,y.Z)(a,"".concat(O,"-wrapper-in-form-item"),de),a),M);return n.createElement("label",{className:D,style:W,onMouseEnter:i.onMouseEnter,onMouseLeave:i.onMouseLeave},n.createElement(ve.Z,(0,j.Z)({},m,{type:"radio",prefixCls:O,ref:ie})),z!==void 0?n.createElement("span",null,z):null)},me=n.forwardRef(fe),V=me,ye=n.forwardRef(function(t,i){var d,a=n.useContext(L.E_),s=a.getPrefixCls,le=a.direction,A=n.useContext(ce.Z),q=(0,K.Z)(t.defaultValue,{value:t.value}),h=(0,B.Z)(q,2),U=h[0],ie=h[1],ue=function(ee){var S=U,v=ee.target.value;"value"in t||ie(v);var c=t.onChange;c&&v!==S&&c(ee)},de=t.prefixCls,p=t.className,T=p===void 0?"":p,M=t.options,z=t.buttonStyle,W=z===void 0?"outline":z,w=t.disabled,Q=t.children,$=t.size,O=t.style,m=t.id,R=t.onMouseEnter,D=t.onMouseLeave,_=t.onFocus,G=t.onBlur,x=s("radio",de),b="".concat(x,"-group"),Z=Q;M&&M.length>0&&(Z=M.map(function(f){return typeof f=="string"||typeof f=="number"?n.createElement(V,{key:f.toString(),prefixCls:x,disabled:w,value:f,checked:U===f},f):n.createElement(V,{key:"radio-group-value-options-".concat(f.value),prefixCls:x,disabled:f.disabled||w,value:f.value,checked:U===f.value,style:f.style},f.label)}));var X=$||A,Y=F()(b,"".concat(b,"-").concat(W),(d={},(0,y.Z)(d,"".concat(b,"-").concat(X),X),(0,y.Z)(d,"".concat(b,"-rtl"),le==="rtl"),d),T);return n.createElement("div",(0,j.Z)({},(0,J.Z)(t),{className:Y,style:O,onMouseEnter:R,onMouseLeave:D,onFocus:_,onBlur:G,id:m,ref:i}),n.createElement(E,{value:{onChange:ue,value:U,disabled:t.disabled,name:t.name,optionType:t.optionType}},Z))}),he=n.memo(ye),r=function(t,i){var d={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&i.indexOf(a)<0&&(d[a]=t[a]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,a=Object.getOwnPropertySymbols(t);s<a.length;s++)i.indexOf(a[s])<0&&Object.prototype.propertyIsEnumerable.call(t,a[s])&&(d[a[s]]=t[a[s]]);return d},pe=function(i,d){var a=n.useContext(L.E_),s=a.getPrefixCls,le=i.prefixCls,A=r(i,["prefixCls"]),q=s("radio",le);return n.createElement(re,{value:"button"},n.createElement(V,(0,j.Z)({prefixCls:q},A,{type:"radio",ref:d})))},xe=n.forwardRef(pe),se=V;se.Button=xe,se.Group=he,se.__ANT_RADIO=!0;var Ce=se},88983:function(ae,N,e){"use strict";var j=e(38663),y=e.n(j),B=e(44943),g=e.n(B)}}]);