Files
GDstarmotion-admin/dist/src__pages__user__register__index.fa46b55c.async.js
PC-202306242200\Administrator 21a9d634e8 更新包
2024-09-10 17:01:38 +08:00

2 lines
5.2 KiB
JavaScript

"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[8263,7015,207],{81028:function(x,u,s){s.r(u);var p=s(48305),t=s.n(p),l=s(7485),a=s(50925),g=s(98984),P=s(47698),h=s(63151),_=s(41268),D=s(25666),C=s(36735),c=s(50159),E=s(50959),S=s(48980),W=s(84526),e=s(11527),v=a.Z.Item,A=g.Z.Option,L={ok:"success",pass:"normal",poor:"exception"},U=function(){var K=(0,W.default)(),o=K.styles,b=(0,E.useState)(0),O=t()(b,2),ae=O[0],M=O[1],w=(0,E.useState)(!1),F=t()(w,2),j=F[0],B=F[1],Z=(0,E.useState)("86"),y=t()(Z,2),G=y[0],N=y[1],z=(0,E.useState)(!1),R=t()(z,2),V=R[0],$=R[1],k=!1,f,H={ok:(0,e.jsx)("div",{className:o.success,children:(0,e.jsx)("span",{children:"\u5F3A\u5EA6\uFF1A\u5F3A"})}),pass:(0,e.jsx)("div",{className:o.warning,children:(0,e.jsx)("span",{children:"\u5F3A\u5EA6\uFF1A\u4E2D"})}),poor:(0,e.jsx)("div",{className:o.error,children:(0,e.jsx)("span",{children:"\u5F3A\u5EA6\uFF1A\u592A\u77ED"})})},J=a.Z.useForm(),Q=t()(J,1),d=Q[0];(0,E.useEffect)(function(){return function(){clearInterval(f)}},[f]);var ue=function(){var r=59;M(r),f=window.setInterval(function(){r-=1,M(r),r===0&&clearInterval(f)},1e3)},I=function(){var r=d.getFieldValue("password");return r&&r.length>9?"ok":r&&r.length>5?"pass":"poor"},T=(0,l.useRequest)(S.fakeRegister,{manual:!0,onSuccess:function(r,n){r.status==="ok"&&(P.ZP.success("\u6CE8\u518C\u6210\u529F\uFF01"),l.history.push({pathname:"/user/register-result?account=".concat(n[0].email)}))}}),X=T.loading,Y=T.run,q=function(r){Y(r)},ee=function(r,n){var m=Promise;return n&&n!==d.getFieldValue("password")?m.reject("\u4E24\u6B21\u8F93\u5165\u7684\u5BC6\u7801\u4E0D\u5339\u914D!"):m.resolve()},se=function(r,n){var m=Promise;return n?(j||B(!!n),$(!V),n.length<6?m.reject(""):(n&&k&&d.validateFields(["confirm"]),m.resolve())):(B(!!n),m.reject("\u8BF7\u8F93\u5165\u5BC6\u7801!"))},re=function(r){N(r)},ne=function(){var r=d.getFieldValue("password"),n=I();return r&&r.length?(0,e.jsx)("div",{className:o["progress-".concat(n)],children:(0,e.jsx)(h.Z,{status:L[n],strokeWidth:6,percent:r.length*10>100?100:r.length*10,showInfo:!1})}):null};return(0,e.jsxs)("div",{className:o.main,children:[(0,e.jsx)("h3",{children:"\u6CE8\u518C"}),(0,e.jsxs)(a.Z,{form:d,name:"UserRegister",onFinish:q,children:[(0,e.jsx)(v,{name:"email",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u90AE\u7BB1\u5730\u5740!"},{type:"email",message:"\u90AE\u7BB1\u5730\u5740\u683C\u5F0F\u9519\u8BEF!"}],children:(0,e.jsx)(_.Z,{size:"large",placeholder:"\u90AE\u7BB1"})}),(0,e.jsx)(D.Z,{getPopupContainer:function(r){return r&&r.parentNode?r.parentNode:r},content:j&&(0,e.jsxs)("div",{style:{padding:"4px 0"},children:[H[I()],ne(),(0,e.jsx)("div",{style:{marginTop:10},children:(0,e.jsx)("span",{children:"\u8BF7\u81F3\u5C11\u8F93\u5165 6 \u4E2A\u5B57\u7B26\u3002\u8BF7\u4E0D\u8981\u4F7F\u7528\u5BB9\u6613\u88AB\u731C\u5230\u7684\u5BC6\u7801\u3002"})})]}),overlayStyle:{width:240},placement:"right",open:j,children:(0,e.jsx)(v,{name:"password",className:d.getFieldValue("password")&&d.getFieldValue("password").length>0&&o.password,rules:[{validator:se}],children:(0,e.jsx)(_.Z,{size:"large",type:"password",placeholder:"\u81F3\u5C116\u4F4D\u5BC6\u7801\uFF0C\u533A\u5206\u5927\u5C0F\u5199"})})}),(0,e.jsx)(v,{name:"confirm",rules:[{required:!0,message:"\u786E\u8BA4\u5BC6\u7801"},{validator:ee}],children:(0,e.jsx)(_.Z,{size:"large",type:"password",placeholder:"\u786E\u8BA4\u5BC6\u7801"})}),(0,e.jsx)(v,{name:"mobile",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u624B\u673A\u53F7!"},{pattern:/^\d{11}$/,message:"\u624B\u673A\u53F7\u683C\u5F0F\u9519\u8BEF!"}],children:(0,e.jsxs)(C.Z.Compact,{style:{width:"100%"},children:[(0,e.jsxs)(g.Z,{size:"large",value:G,onChange:re,style:{width:"30%"},children:[(0,e.jsx)(A,{value:"86",children:"+86"}),(0,e.jsx)(A,{value:"87",children:"+87"})]}),(0,e.jsx)(_.Z,{size:"large",placeholder:"\u624B\u673A\u53F7"})]})}),(0,e.jsx)(v,{children:(0,e.jsxs)("div",{className:o.footer,children:[(0,e.jsx)(c.ZP,{size:"large",loading:X,className:o.submit,type:"primary",htmlType:"submit",children:(0,e.jsx)("span",{children:"\u6CE8\u518C"})}),(0,e.jsx)(l.Link,{to:"/user/login",children:(0,e.jsx)("span",{children:"\u4F7F\u7528\u5DF2\u6709\u8D26\u6237\u767B\u5F55"})})]})})]})]})};u.default=U},48980:function(x,u,s){s.r(u),s.d(u,{fakeRegister:function(){return P}});var p=s(90228),t=s.n(p),l=s(87999),a=s.n(l),g=s(7485);function P(_){return h.apply(this,arguments)}function h(){return h=a()(t()().mark(function _(D){return t()().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.abrupt("return",(0,g.request)("/api/register",{method:"POST",data:D}));case 1:case"end":return c.stop()}},_)})),h.apply(this,arguments)}},84526:function(x,u,s){s.r(u);var p=s(13179),t=(0,p.kc)(function(l){var a=l.token;return{main:{width:"368px",margin:"0 auto",h3:{marginBottom:"20px",fontSize:"16px"}},password:{marginBottom:"24px",".ant-form-item-explain":{display:"none"}},getCaptcha:{display:"block",width:"100%"},footer:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between"},submit:{width:"50%"},success:{transition:"color 0.3s",color:a.colorSuccess},warning:{transition:"color 0.3s",color:a.colorWarning},error:{transition:"color 0.3s",color:a.colorError},"progress-pass > .progress":{".ant-progress-bg":{backgroundColor:a.colorWarning}}}});u.default=t}}]);