2 lines
9.3 KiB
JavaScript
2 lines
9.3 KiB
JavaScript
"use strict";(self.webpackChunkboluo_admin=self.webpackChunkboluo_admin||[]).push([[37],{36667:function(ie,R,e){var U=e(35887),d=e(36161),A=e(11267),O=e(7469),K=e(35648),B=e(60498),H=e(71770),V=e(75271),o=e(17146),a=e(52676),$=["fieldProps","proFieldProps"],b=["fieldProps","proFieldProps"],C="text",G=function(r){var n=r.fieldProps,x=r.proFieldProps,m=(0,A.Z)(r,$);return(0,a.jsx)(o.Z,(0,d.Z)({valueType:C,fieldProps:n,filedConfig:{valueType:C},proFieldProps:x},m))},X=function(r){var n=(0,O.Z)(r.open||!1,{value:r.open,onChange:r.onOpenChange}),x=(0,U.Z)(n,2),m=x[0],D=x[1];return(0,a.jsx)(K.Z.Item,{shouldUpdate:!0,noStyle:!0,children:function(I){var P,L=I.getFieldValue(r.name||[]);return(0,a.jsx)(B.Z,(0,d.Z)((0,d.Z)({getPopupContainer:function(s){return s&&s.parentNode?s.parentNode:s},onOpenChange:function(s){return D(s)},content:(0,a.jsxs)("div",{style:{padding:"4px 0"},children:[(P=r.statusRender)===null||P===void 0?void 0:P.call(r,L),r.strengthText?(0,a.jsx)("div",{style:{marginTop:10},children:(0,a.jsx)("span",{children:r.strengthText})}):null]}),overlayStyle:{width:240},placement:"rightTop"},r.popoverProps),{},{open:m,children:r.children}))}})},Y=function(r){var n=r.fieldProps,x=r.proFieldProps,m=(0,A.Z)(r,b),D=(0,V.useState)(!1),F=(0,U.Z)(D,2),I=F[0],P=F[1];return n!=null&&n.statusRender&&m.name?(0,a.jsx)(X,{name:m.name,statusRender:n==null?void 0:n.statusRender,popoverProps:n==null?void 0:n.popoverProps,strengthText:n==null?void 0:n.strengthText,open:I,onOpenChange:P,children:(0,a.jsx)("div",{children:(0,a.jsx)(o.Z,(0,d.Z)({valueType:"password",fieldProps:(0,d.Z)((0,d.Z)({},(0,H.Z)(n,["statusRender","popoverProps","strengthText"])),{},{onBlur:function(S){var s;n==null||(s=n.onBlur)===null||s===void 0||s.call(n,S),P(!1)},onClick:function(S){var s;n==null||(s=n.onClick)===null||s===void 0||s.call(n,S),P(!0)}}),proFieldProps:x,filedConfig:{valueType:C}},m))})}):(0,a.jsx)(o.Z,(0,d.Z)({valueType:"password",fieldProps:n,proFieldProps:x,filedConfig:{valueType:C}},m))},M=G;M.Password=Y,M.displayName="ProFormComponent",R.Z=M},8893:function(ie,R,e){e.r(R),e.d(R,{default:function(){return ye}});var U=e(90228),d=e.n(U),A=e(26068),O=e.n(A),K=e(87999),B=e.n(K),H=e(48305),V=e.n(H),o=e(36161),a=e(75271),$={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M858.5 763.6a374 374 0 00-80.6-119.5 375.63 375.63 0 00-119.5-80.6c-.4-.2-.8-.3-1.2-.5C719.5 518 760 444.7 760 362c0-137-111-248-248-248S264 225 264 362c0 82.7 40.5 156 102.8 201.1-.4.2-.8.3-1.2.5-44.8 18.9-85 46-119.5 80.6a375.63 375.63 0 00-80.6 119.5A371.7 371.7 0 00136 901.8a8 8 0 008 8.2h60c4.4 0 7.9-3.5 8-7.8 2-77.2 33-149.5 87.8-204.3 56.7-56.7 132-87.9 212.2-87.9s155.5 31.2 212.2 87.9C779 752.7 810 825 812 902.2c.1 4.4 3.6 7.8 8 7.8h60a8 8 0 008-8.2c-1-47.8-10.9-94.3-29.5-138.2zM512 534c-45.9 0-89.1-17.9-121.6-50.4S340 407.9 340 362c0-45.9 17.9-89.1 50.4-121.6S466.1 190 512 190s89.1 17.9 121.6 50.4S684 316.1 684 362c0 45.9-17.9 89.1-50.4 121.6S557.9 534 512 534z"}}]},name:"user",theme:"outlined"},b=$,C=e(58720),G=function(u,c){return a.createElement(C.Z,(0,o.Z)((0,o.Z)({},u),{},{ref:c,icon:b}))},X=a.forwardRef(G),Y=X,M={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 464h-68V240c0-70.7-57.3-128-128-128H388c-70.7 0-128 57.3-128 128v224h-68c-17.7 0-32 14.3-32 32v384c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V496c0-17.7-14.3-32-32-32zM332 240c0-30.9 25.1-56 56-56h248c30.9 0 56 25.1 56 56v224H332V240zm460 600H232V536h560v304zM484 701v53c0 4.4 3.6 8 8 8h40c4.4 0 8-3.6 8-8v-53a48.01 48.01 0 10-56 0z"}}]},name:"lock",theme:"outlined"},W=M,r=function(u,c){return a.createElement(C.Z,(0,o.Z)((0,o.Z)({},u),{},{ref:c,icon:W}))},n=a.forwardRef(r),x=n,m=e(11267),D=e(67068),F=e(58661),I=e(82187),P=e.n(I),L=e(88271),S=e(30016),s=e(4701),ue=function(u){return(0,S.Z)((0,S.Z)({},u.componentCls,{"&-container":{display:"flex",flex:"1",flexDirection:"column",height:"100%",paddingInline:32,paddingBlock:24,overflow:"auto",background:"inherit"},"&-top":{textAlign:"center"},"&-header":{display:"flex",alignItems:"center",justifyContent:"center",height:"44px",lineHeight:"44px",a:{textDecoration:"none"}},"&-title":{position:"relative",insetBlockStart:"2px",color:"@heading-color",fontWeight:"600",fontSize:"33px"},"&-logo":{width:"44px",height:"44px",marginInlineEnd:"16px",verticalAlign:"top",img:{width:"100%"}},"&-desc":{marginBlockStart:"12px",marginBlockEnd:"40px",color:u.colorTextSecondary,fontSize:u.fontSize},"&-main":{minWidth:"328px",maxWidth:"580px",margin:"0 auto","&-other":{marginBlockStart:"24px",lineHeight:"22px",textAlign:"start"}}}),"@media (min-width: @screen-md-min)",(0,S.Z)({},"".concat(u.componentCls,"-container"),{paddingInline:0,paddingBlockStart:32,paddingBlockEnd:24,backgroundRepeat:"no-repeat",backgroundPosition:"center 110px",backgroundSize:"100%"}))};function de(i){return(0,s.Xj)("LoginForm",function(u){var c=(0,o.Z)((0,o.Z)({},u),{},{componentCls:".".concat(i)});return[ue(c)]})}var t=e(52676),ce=["logo","message","contentStyle","title","subTitle","actions","children","containerStyle","otherStyle"];function ve(i){var u,c=i.logo,Q=i.message,w=i.contentStyle,E=i.title,j=i.subTitle,N=i.actions,k=i.children,q=i.containerStyle,_=i.otherStyle,v=(0,m.Z)(i,ce),T=(0,D.YB)(),p=v.submitter===!1?!1:(0,o.Z)((0,o.Z)({searchConfig:{submitText:T.getMessage("loginForm.submitText","\u767B\u5F55")}},v.submitter),{},{submitButtonProps:(0,o.Z)({size:"large",style:{width:"100%"}},(u=v.submitter)===null||u===void 0?void 0:u.submitButtonProps),render:function(ne,se){var te,Ce=se.pop();if(typeof(v==null||(te=v.submitter)===null||te===void 0?void 0:te.render)=="function"){var z,re;return v==null||(z=v.submitter)===null||z===void 0||(re=z.render)===null||re===void 0?void 0:re.call(z,ne,se)}return Ce}}),h=(0,a.useContext)(F.ZP.ConfigContext),f=h.getPrefixCls("pro-form-login"),g=de(f),y=g.wrapSSR,l=g.hashId,Z=function(ne){return"".concat(f,"-").concat(ne," ").concat(l)},ee=(0,a.useMemo)(function(){return c?typeof c=="string"?(0,t.jsx)("img",{src:c}):c:null},[c]);return y((0,t.jsxs)("div",{className:P()(Z("container"),l),style:q,children:[(0,t.jsxs)("div",{className:"".concat(Z("top")," ").concat(l).trim(),children:[E||ee?(0,t.jsxs)("div",{className:"".concat(Z("header")),children:[ee?(0,t.jsx)("span",{className:Z("logo"),children:ee}):null,E?(0,t.jsx)("span",{className:Z("title"),children:E}):null]}):null,j?(0,t.jsx)("div",{className:Z("desc"),children:j}):null]}),(0,t.jsxs)("div",{className:Z("main"),style:(0,o.Z)({width:328},w),children:[(0,t.jsxs)(L.A,(0,o.Z)((0,o.Z)({isKeyPressSubmit:!0},v),{},{submitter:p,children:[Q,k]})),N?(0,t.jsx)("div",{className:Z("main-other"),style:_,children:N}):null]})]}))}var le=e(36667),J=e(67929),ae=e(87447),fe=e(32650),he=e(13033),ge=e(30967),me=e(94109),pe=e(79685),xe=e(48804),oe=e(84606),Pe=(0,he.kc)(function(){return{container:{display:"flex",flexDirection:"column",height:"100vh",overflow:"auto"}}}),Se=function(){var u=(0,a.useState)(!1),c=V()(u,2),Q=c[0],w=c[1],E=(0,J.useModel)("@@initialState"),j=E.initialState,N=E.setInitialState,k=Pe(),q=k.styles,_=function(){var T=B()(d()().mark(function p(){var h,f;return d()().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,j==null||(h=j.fetchUserInfo)===null||h===void 0?void 0:h.call(j);case 2:f=y.sent,f&&(0,ge.flushSync)(function(){N(function(l){return O()(O()({},l),{},{currentUser:f})})});case 4:case"end":return y.stop()}},p)}));return function(){return T.apply(this,arguments)}}(),v=function(){var T=B()(d()().mark(function p(h){var f,g;return d()().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.prev=0,console.log("login params",h),l.next=4,(0,pe.x4)(O()({},h));case 4:if(f=l.sent,!f.token){l.next=13;break}return(0,xe.o4)(f.token),ae.ZP.success("\u767B\u5F55\u6210\u529F\uFF01"),l.next=10,_();case 10:return g=new URL(window.location.href).searchParams,J.history.push(g.get("redirect")||"/"),l.abrupt("return");case 13:console.log(f),w(!0),l.next=21;break;case 17:l.prev=17,l.t0=l.catch(0),console.log(l.t0),ae.ZP.error("\u767B\u5F55\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\uFF01");case 21:case"end":return l.stop()}},p,null,[[0,17]])}));return function(h){return T.apply(this,arguments)}}();return(0,t.jsxs)("div",{className:q.container,children:[(0,t.jsx)(J.Helmet,{children:(0,t.jsxs)("title",{children:["\u767B\u5F55","- ",oe.Z.title]})}),(0,t.jsx)("div",{style:{flex:"1",padding:"32px 0"},children:(0,t.jsxs)(ve,{contentStyle:{minWidth:280,maxWidth:"75vw"},logo:(0,t.jsx)("img",{alt:"logo",src:oe.Z.logo}),subTitle:" ",title:"\u64AD\u7EDC\u7BA1\u7406\u540E\u53F0",initialValues:{autoLogin:!0},onFinish:function(){var T=B()(d()().mark(function p(h){return d()().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,v(h);case 2:case"end":return g.stop()}},p)}));return function(p){return T.apply(this,arguments)}}(),children:[(0,t.jsx)(le.Z,{name:"userName",fieldProps:{size:"large",prefix:(0,t.jsx)(Y,{})},placeholder:"\u8BF7\u8F93\u5165\u8D26\u53F7",rules:[{required:!0,message:"\u8D26\u53F7\u4E0D\u80FD\u4E3A\u7A7A!"}]}),(0,t.jsx)(le.Z.Password,{name:"pwd",fieldProps:{size:"large",prefix:(0,t.jsx)(x,{})},placeholder:"\u8BF7\u8F93\u5165\u5BC6\u7801",rules:[{required:!0,message:"\u5BC6\u7801\u4E0D\u80FD\u4E3A\u7A7A!"}]}),Q&&(0,t.jsx)(fe.Z,{style:{marginBottom:24},message:"\u7528\u6237\u540D\u6216\u5BC6\u7801\u9519\u8BEF",type:"error",showIcon:!0})]})}),(0,t.jsx)(me.Z,{})]})},ye=Se}}]);
|