|
|
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[27182],{75742:function(e,n,t){t.d(n,{Z:function(){return c}});var r=t(4751),i=t(59301),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"}}]},name:"check",theme:"outlined"},s=t(68475),a=function(e,n){return i.createElement(s.Z,(0,r.Z)({},e,{ref:n,icon:o}))};var c=i.forwardRef(a)},77094:function(e,n,t){t.d(n,{Z:function(){return c}});var r=t(4751),i=t(59301),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M533.2 492.3L277.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H188c-6.7 0-10.4 7.7-6.3 12.9L447.1 512 181.7 851.1A7.98 7.98 0 00188 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5zm304 0L581.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H492c-6.7 0-10.4 7.7-6.3 12.9L751.1 512 485.7 851.1A7.98 7.98 0 00492 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5z"}}]},name:"double-right",theme:"outlined"},s=t(68475),a=function(e,n){return i.createElement(s.Z,(0,r.Z)({},e,{ref:n,icon:o}))};var c=i.forwardRef(a)},26900:function(e,n,t){t.d(n,{Z:function(){return x}});var r=t(7557),i=t.n(r),o=t(41498),s=t.n(o),a=t(79800),c=t.n(a),u=t(82242),l=t.n(u),d=t(59301),f=t(14834),m=t(75742),p=t(77094),v=t(26795),h=t(37712),w={moveX:0,verify:0},g=function(e){return e[e.SET_MOVEX=0]="SET_MOVEX",e[e.VERIFY=1]="VERIFY",e}(g||{});function y(e,n){switch(n.type){case g.SET_MOVEX:return l()(l()({},e),{},{moveX:n.payload});case g.VERIFY:return l()(l()({},e),n.payload);default:throw new Error}}var x=function(e){var n=e.value,t=e.onChange,r=e.onValidate,o=(0,d.useReducer)(y,w),a=c()(o,2),u=a[0],l=a[1],x=u.moveX,j=u.verify,E=(0,d.useRef)(),_=(0,d.useRef)(),b=(0,d.useRef)(),k=(0,d.useRef)(),Z=(0,d.useMemo)((function(){if(_.current)return _.current.getBoundingClientRect()}),[_.current]);function F(){j||(k.current=!0,E.current.style.transition="",b.current.style.transition="")}return(0,d.useEffect)((function(){if(Z){var e=function(){var e=s()(i()().mark((function e(n){var s;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!k.current){e.next=15;break}if(s=n.pageX-c,d&&(s=n.changedTouches[0].pageX-c),s<0&&(s=0),!(s>=u)){e.next=14;break}return k.current=!1,s=u,e.next=9,r();case 9:o=e.sent,l({type:g.VERIFY,payload:{moveX:s,verify:o}}),t(o),e.next=15;break;case 14:l({type:g.SET_MOVEX,payload:s});case 15:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),n=function(){k.current=!1,0===o&&(E.current.style.transition="left .5s ease",b.current.style.transition="width .5s ease",l({type:g.VERIFY,payload:{moveX:0}}))},o=0,a=Z.width,c=Z.left,u=a-48,d=!(0,v.b9)();return d?(window.addEventListener("touchmove",e),window.addEventListener("touchend",n)):(window.addEventListener("mousemove",e),window.addEventListener("mouseup",n)),function(){d?(window.removeEventListener("touchmove",e),window.removeEventListener("touchend",n)):(window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",n))}}}),[Z,v.b9]),(0,d.useEffect)((function(){l({type:g.VERIFY,payload:{verify:n,moveX:n?(null==Z?void 0:Z.width)-48:0}})}),[n]),(0,h.jsxs)("div",{ref:_,className:"unlock-wrapper",children:[(0,h.jsx)("div",{ref:b,className:1===j?"unlock-error-bg":"unlock-bg",style:{width:x}}),(0,h.jsx)("div",{className:"unlock-text",children:j?1===j?"验证失败":"验证通过":"拖动滑块至右侧验证"}),(0,h.jsx)("div",{ref:E,onTouchStart:F,onMouseDown:F,style:{left:x},className:"unlock-handler",children:j?1===j?(0,h.jsx)(f.Z,{}):(0,h.jsx)(m.Z,{}):(0,h.jsx)(p.Z,{})})]})}},81361:function(e,n,t){t.d(n,{Ol:function(){return i},c0:function(){return a},o1:function(){return o},z2:function(){return s}});var r=t(27786);function i(e){return(0,r.U2)("accounts/valid_email_and_phone.json",e)}function o(e){return(0,r.U2)("accounts/get_verification_code.json",e)}function s(e){return(0,r.v_)("accounts/register.json",e)}function a(e){return(0,r.v_)("accounts/reset_password.json",e)}},36098:function(e,n,t){t.r(n),t.d(n,{default:function(){return I}});var r=t(82242),i=t.n(r),o=t(7557),s=t.n(o),a=t(41498),c=t.n(a),u=t(59301),l=t(79800),d=t.n(l),f=t(78241),m=t(98135),p=t(3113),v=t(26900),h=t(26795),w=t(65233),g="wrap___jh1g8",y="formWrapper___ac7hS",x=t(37712),j={height:48,borderRadius:4},E=/(\b[\w\.-]+@[\w\.-]+\.\w{2,4}\b)|(^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$)/i,_={timer:0},b=function(e){return e[e.setTimer=0]="setTimer",e}(b||{});function k(e,n){if(n.type===b.setTimer)return i()(i()({},e),{},{timer:n.payload});throw new Error}var Z=function(e){var n=e.validateName,t=e.getCode,r=e.callback,i=e.style,o=void 0===i?{}:i,a=((0,w.useLocation)(),(0,w.useSearchParams)()),l=d()(a,1)[0],Z=f.Z.useForm(),F=d()(Z,1)[0],I=(0,u.useReducer)(k,_),V=d()(I,2),R=V[0],P=V[1],L=(0,u.useState)(!1),T=d()(L,2),O=T[0],M=T[1],X=R.timer;function C(){return(C=c()(s()().mark((function e(n){var t,i,o,a,c,u,d,f,m,p;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.login,i=n.new_password,o=n.code,a=n.new_password_confirmation,e.next=3,r({login:t,new_password_confirmation:a,new_password:i,code:o});case 3:c=e.sent,u=c.message,d=c.status,f=c.show,m=c.start_date,0===d?(f?(localStorage.setItem("extension-modal","exist"),localStorage.setItem("extension-date",m)):localStorage.removeItem("extension-modal"),(p=l.get("from"))&&p.indexOf("login")<0?w.history.replace(p):w.history.replace("/")):F.setFields([{name:"code",errors:[u]}]);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function S(){return(S=c()(s()().mark((function e(){var t,r,i,o,a;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=F.getFieldValue("login"),r=0,E.test(t)&&!(t.indexOf(" ")>-1)){e.next=6;break}return F.setFields([{name:"login",errors:["请输入正确的手机号或邮箱"]}]),r=1,e.abrupt("return",r);case 6:return e.next=8,n({login:t,type:2});case 8:return i=e.sent,o=i.status,a=i.message,o>0?r=2:(F.setFields([{name:"login",errors:[a]}]),r=1),e.abrupt("return",r);case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var $=function(){var e=c()(s()().mark((function e(){var n,r,i,o,a;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=F.getFieldValue("verify"),r=F.getFieldValue("login"),n){e.next=6;break}F.validateFields(["verify"]),e.next=15;break;case 6:return M(!0),e.next=9,t({login:r,type:2,smscode:(0,h.M)(r)});case 9:i=e.sent,o=i.status,a=i.message,o<0&&F.setFields([{name:"code",errors:[a]}]),P({type:b.setTimer,payload:60}),M(!1);case 15:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();(0,u.useEffect)((function(){X>0&&setTimeout((function(){P({type:b.setTimer,payload:X-1})}),1e3)}),[X]);return(0,x.jsx)("div",{className:g,children:(0,x.jsxs)(f.Z,{layout:"vertical",form:F,style:o,className:y,initialValues:{autologin:!0,protool:!0},onFinish:function(e){return C.apply(this,arguments)},children:[(0,x.jsx)(f.Z.Item,{name:"login",label:"账号",required:!1,rules:[{required:!0,message:"请输入正确的手机号或邮箱"},{validator:function(e,n){return n?n.indexOf(" ")>-1?Promise.reject("请输入正确的手机号或邮箱"):E.test(n)?Promise.resolve():Promise.reject("请输入正确的手机号或邮箱"):Promise.resolve()}}],children:(0,x.jsx)(m.Z,{style:j,size:"middle",placeholder:"请输入有效的手机号/邮箱号",onChange:function(){return F.setFieldsValue({verify:0})}})}),(0,x.jsx)(f.Z.Item,{name:"verify",rules:[{validator:function(e,n){return n?Promise.resolve():Promise.reject("请拖动滑块验证")}}],children:(0,x.jsx)(v.Z,{onValidate:function(){return S.apply(this,arguments)}})}),(0,x.jsx)(f.Z.Item,{label:"密码",required:!1,name:"new_password",rules:[{required:!0,message:"请输入8-16位密码,区分大小写、不能使用空格"},{validator:function(e,n){var t=F.getFieldValue("new_password_confirmation");if(!n)return Promise.resolve();if(F.setFields([{name:"new_password_confirmation",errors:t&&t!==n?["两次密码不一致"]:[]}]),n.indexOf(" ")>-1)return Promise.reject("请输入8-16位密码,区分大小写、不能使用空格");var r=n.length;return r>=8&&r<=16?Promise.resolve():Promise.reject("请输入8-16位密码,区分大小写、不能使用空格")}}],children:(0,x.jsx)(m.Z.Password,{style:j,size:"middle",placeholder:"输入8~16位密码,区分大小写",visibilityToggle:!1})}),(0,x.jsx)(f.Z.Item,{name:"new_password_confirmation",rules:[{required:!0,message:"请再次输入新密码"},function(e){var n=e.getFieldValue;return{validator:function(e,t){return t&&n("new_password")!==t?Promise.reject("两次密码不一致"):Promise.resolve()}}}],children:(0,x.jsx)(m.Z.Password,{style:j,size:"middle",placeholder:"再次输入新密码",visibilityToggle:!1})}),(0,x.jsx)(f.Z.Item,{name:"code",label:"验证码",required:!1,rules:[{required:!0,message:"请输入验证码"}],children:(0,x.jsx)(m.Z,{suffix:(0,x.jsxs)(p.ZP,{loading:O,type:"link",onClick:$,disabled:X>0,children:[" ",0===X?"获取验证码":"".concat(X,"秒可重新获取")]}),style:{paddingRight:2,height:48,borderRadius:4},placeholder:"请输入验证码",size:"middle"})}),(0,x.jsx)(f.Z.Item,{children:(0,x.jsx)(p.ZP,{size:"middle",type:"primary",htmlType:"submit",block:!0,style:j,children:" 完成 "})}),(0,x.jsx)(f.Z.Item,{className:"tc",children:(0,x.jsx)(w.Link,{className:"font14",to:"/user/login",children:"返回登录"})})]})})},F=t(81361),I=function(){var e,n={getCode:F.o1,callback:(e=c()(s()().mark((function e(n){var t;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,F.c0)(n);case 2:return t=e.sent,e.abrupt("return",t);case 4:case"end":return e.stop()}}),e)}))),function(n){return e.apply(this,arguments)}),validateName:F.Ol};return(0,x.jsx)(Z,i()({},n))}},8378:function(e,n){n.Z=e=>({[e.componentCls]:{[`${e.antCls}-motion-collapse-legacy`]:{overflow:"hidden","&-active":{transition:`height ${e.motionDurationMid} ${e.motionEaseInOut},\n opacity ${e.motionDurationMid} ${e.motionEaseInOut} !important`}},[`${e.antCls}-motion-collapse`]:{overflow:"hidden",transition:`height ${e.motionDurationMid} ${e.motionEaseInOut},\n opacity ${e.motionDurationMid} ${e.motionEaseInOut} !important`}}})}}]); |