answerBi-frontend/p__User__Login__index.14e6857c.async.js
2024-04-07 14:11:06 +08:00

2 lines
8.7 KiB
JavaScript

"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[366],{94149:function(N,D,e){e.d(D,{Z:function(){return S}});var m=e(1413),o=e(67294),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"},O=M,A=e(91146),E=function(i,T){return o.createElement(A.Z,(0,m.Z)((0,m.Z)({},i),{},{ref:T,icon:O}))},j=o.forwardRef(E),S=j},5966:function(N,D,e){var m=e(97685),o=e(1413),M=e(91),O=e(21770),A=e(98138),E=e(55241),j=e(97435),S=e(67294),p=e(11911),i=e(85893),T=["fieldProps","proFieldProps"],W=["fieldProps","proFieldProps"],d="text",R=function(r){var n=r.fieldProps,f=r.proFieldProps,t=(0,M.Z)(r,T);return(0,i.jsx)(p.Z,(0,o.Z)({valueType:d,fieldProps:n,filedConfig:{valueType:d},proFieldProps:f},t))},U=function(r){var n=(0,O.Z)(r.open||!1,{value:r.open,onChange:r.onOpenChange}),f=(0,m.Z)(n,2),t=f[0],C=f[1];return(0,i.jsx)(A.Z.Item,{shouldUpdate:!0,noStyle:!0,children:function(B){var g,u=B.getFieldValue(r.name||[]);return(0,i.jsx)(E.Z,(0,o.Z)((0,o.Z)({getPopupContainer:function(v){return v&&v.parentNode?v.parentNode:v},onOpenChange:C,content:(0,i.jsxs)("div",{style:{padding:"4px 0"},children:[(g=r.statusRender)===null||g===void 0?void 0:g.call(r,u),r.strengthText?(0,i.jsx)("div",{style:{marginTop:10},children:(0,i.jsx)("span",{children:r.strengthText})}):null]}),overlayStyle:{width:240},placement:"rightTop"},r.popoverProps),{},{open:t,children:r.children}))}})},s=function(r){var n=r.fieldProps,f=r.proFieldProps,t=(0,M.Z)(r,W),C=(0,S.useState)(!1),Z=(0,m.Z)(C,2),B=Z[0],g=Z[1];return n!=null&&n.statusRender&&t.name?(0,i.jsx)(U,{name:t.name,statusRender:n==null?void 0:n.statusRender,popoverProps:n==null?void 0:n.popoverProps,strengthText:n==null?void 0:n.strengthText,open:B,onOpenChange:g,children:(0,i.jsx)("div",{children:(0,i.jsx)(p.Z,(0,o.Z)({valueType:"password",fieldProps:(0,o.Z)((0,o.Z)({},(0,j.Z)(n,["statusRender","popoverProps","strengthText"])),{},{onBlur:function(y){var v;n==null||(v=n.onBlur)===null||v===void 0||v.call(n,y),g(!1)},onClick:function(y){var v;n==null||(v=n.onClick)===null||v===void 0||v.call(n,y),g(!0)}}),proFieldProps:f,filedConfig:{valueType:d}},t))})}):(0,i.jsx)(p.Z,(0,o.Z)({valueType:"password",fieldProps:n,proFieldProps:f,filedConfig:{valueType:d}},t))},l=R;l.Password=s,l.displayName="ProFormComponent",D.Z=l},68262:function(N,D,e){e.d(D,{U:function(){return U}});var m=e(1413),o=e(91),M=e(89451),O=e(28459),A=e(93967),E=e.n(A),j=e(67294),S=e(34994),p=e(4942),i=e(98082),T=function(l){return(0,p.Z)((0,p.Z)({},l.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:l.colorTextSecondary,fontSize:l.fontSize},"&-main":{minWidth:"328px",maxWidth:"580px",margin:"0 auto","&-other":{marginBlockStart:"24px",lineHeight:"22px",textAlign:"start"}}}),"@media (min-width: @screen-md-min)",(0,p.Z)({},"".concat(l.componentCls,"-container"),{paddingInline:0,paddingBlockStart:32,paddingBlockEnd:24,backgroundRepeat:"no-repeat",backgroundPosition:"center 110px",backgroundSize:"100%"}))};function W(s){return(0,i.Xj)("LoginForm",function(l){var h=(0,m.Z)((0,m.Z)({},l),{},{componentCls:".".concat(s)});return[T(h)]})}var d=e(85893),R=["logo","message","contentStyle","title","subTitle","actions","children","containerStyle","otherStyle"];function U(s){var l,h=s.logo,r=s.message,n=s.contentStyle,f=s.title,t=s.subTitle,C=s.actions,Z=s.children,B=s.containerStyle,g=s.otherStyle,u=(0,o.Z)(s,R),y=(0,M.YB)(),v=u.submitter===!1?!1:(0,m.Z)((0,m.Z)({searchConfig:{submitText:y.getMessage("loginForm.submitText","\u767B\u5F55")}},u.submitter),{},{submitButtonProps:(0,m.Z)({size:"large",style:{width:"100%"}},(l=u.submitter)===null||l===void 0?void 0:l.submitButtonProps),render:function(c,L){var b,$=L.pop();if(typeof(u==null||(b=u.submitter)===null||b===void 0?void 0:b.render)=="function"){var a,V;return u==null||(a=u.submitter)===null||a===void 0||(V=a.render)===null||V===void 0?void 0:V.call(a,c,L)}return $}}),z=(0,j.useContext)(O.ZP.ConfigContext),K=z.getPrefixCls("pro-form-login"),F=W(K),H=F.wrapSSR,x=F.hashId,_=function(c){return"".concat(K,"-").concat(c," ").concat(x)},P=(0,j.useMemo)(function(){return h?typeof h=="string"?(0,d.jsx)("img",{src:h}):h:null},[h]);return H((0,d.jsxs)("div",{className:E()(_("container"),x),style:B,children:[(0,d.jsxs)("div",{className:"".concat(_("top")," ").concat(x).trim(),children:[f||P?(0,d.jsxs)("div",{className:"".concat(_("header")),children:[P?(0,d.jsx)("span",{className:_("logo"),children:P}):null,f?(0,d.jsx)("span",{className:_("title"),children:f}):null]}):null,t?(0,d.jsx)("div",{className:_("desc"),children:t}):null]}),(0,d.jsxs)("div",{className:_("main"),style:(0,m.Z)({width:328},n),children:[(0,d.jsxs)(S.A,(0,m.Z)((0,m.Z)({isKeyPressSubmit:!0},u),{},{submitter:v,children:[r,Z]})),C?(0,d.jsx)("div",{className:_("main-other"),style:g,children:C}):null]})]}))}},2067:function(N,D,e){e.r(D);var m=e(15009),o=e.n(m),M=e(97857),O=e.n(M),A=e(99289),E=e.n(A),j=e(5574),S=e.n(j),p=e(66116),i=e(42127),T=e(87547),W=e(94149),d=e(68262),R=e(5966),U=e(28906),s=e(35312),l=e(2453),h=e(11941),r=e(67294),n=e(73935),f=e(67610),t=e(85893),C=function(){var B=(0,r.useState)("account"),g=S()(B,2),u=g[0],y=g[1],v=(0,s.useModel)("@@initialState"),z=v.setInitialState,K=(0,U.l)(function(){return{display:"flex",flexDirection:"column",height:"100vh",overflow:"auto",backgroundImage:"url('https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/V-_oS6r-i7wAAAAAAAAAAAAAFl94AQBr')",backgroundSize:"100% 100%"}}),F=function(){var x=E()(o()().mark(function _(){var P;return o()().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,(0,i._I)();case 2:P=c.sent,P&&(0,n.flushSync)(function(){z(function(L){return O()(O()({},L),{},{currentUser:P.data})})});case 4:case"end":return c.stop()}},_)}));return function(){return x.apply(this,arguments)}}(),H=function(){var x=E()(o()().mark(function _(P){var I,c,L,b;return o()().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,(0,i.E9)(P);case 3:if(I=a.sent,I.code!==0){a.next=14;break}return c="\u767B\u5F55\u6210\u529F\uFF01",l.ZP.success(c),a.next=9,F();case 9:return L=new URL(window.location.href).searchParams,s.history.push(L.get("redirect")||"/"),a.abrupt("return");case 14:l.ZP.error(I.message);case 15:a.next=22;break;case 17:a.prev=17,a.t0=a.catch(0),b="\u767B\u5F55\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\uFF01",console.log(a.t0),l.ZP.error(b);case 22:case"end":return a.stop()}},_,null,[[0,17]])}));return function(P){return x.apply(this,arguments)}}();return(0,t.jsxs)("div",{className:K,children:[(0,t.jsx)(s.Helmet,{children:(0,t.jsxs)("title",{children:["\u767B\u5F55","- ",f.Z.title]})}),(0,t.jsx)("div",{style:{flex:"1",padding:"32px 0"},children:(0,t.jsxs)(d.U,{contentStyle:{minWidth:280,maxWidth:"75vw"},logo:(0,t.jsx)("img",{alt:"logo",src:"/logo.svg"}),title:"Ans\u667A\u80FDBI",subTitle:"Ans\u667A\u80FDBI - \u4E00\u952E\u751F\u6210\u56FE\u8868\uFF0C\u667A\u80FD\u5206\u6790",onFinish:function(){var x=E()(o()().mark(function _(P){return o()().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,H(P);case 2:case"end":return c.stop()}},_)}));return function(_){return x.apply(this,arguments)}}(),children:[(0,t.jsx)(h.Z,{activeKey:u,onChange:y,centered:!0,items:[{key:"account",label:"\u8D26\u6237\u5BC6\u7801\u767B\u5F55"}]}),u==="account"&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(R.Z,{name:"userAccount",fieldProps:{size:"large",prefix:(0,t.jsx)(T.Z,{})},placeholder:"\u8BF7\u8F93\u5165\u7528\u6237\u540D",rules:[{required:!0,message:"\u7528\u6237\u540D\u662F\u5FC5\u586B\u9879\uFF01"}]}),(0,t.jsx)(R.Z.Password,{name:"userPassword",fieldProps:{size:"large",prefix:(0,t.jsx)(W.Z,{})},placeholder:"\u8BF7\u8F93\u5165\u5BC6\u7801",rules:[{required:!0,message:"\u5BC6\u7801\u662F\u5FC5\u586B\u9879\uFF01"}]})]}),(0,t.jsx)("div",{style:{marginBottom:24},children:(0,t.jsx)(s.Link,{to:"/user/register",children:"\u6CE8\u518C"})})]})}),(0,t.jsx)(p.Z,{})]})};D.default=C}}]);