You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
13 KiB
1 line
13 KiB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[31,14],{"0NIp":function(e,a,t){"use strict";t.r(a);t("MPZO");var n=t("bnk9"),r=(t("DHCt"),t("CRgH")),o=t("HP/p"),c=t("VBJJ"),l=t.n(c),s=(t("X/R0"),t("M6G9")),i=t("z3+T"),u=(t("EkPb"),t("7X0+")),m=t("GZha"),d=t("buSX"),p=t("ZZRV"),b=t.n(p),f=t("9kvl"),v=t("bu1o"),E=t.n(v);function _(e,a){var t=Object(p["useRef"])(),n=Object(p["useRef"])();Object(p["useEffect"])((function(){t.current=e})),Object(p["useEffect"])((function(){function e(){t.current()}if(null!==a){var r=setInterval(e,a);return n.current=r,function(){return clearInterval(r)}}}),[a])}var g,h=t("1vsH");(function(e){e[e["Phone"]=1]="Phone",e[e["Email"]=2]="Email",e[e["Password"]=3]="Password"})(g||(g={}));var w=/^1\d{10}$/,y=/^[a-zA-Z0-9]+([.\-_\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/,I=function(e,a,t){a?a.length<8||a.length>16?t("\u8bf7\u8f93\u51658-16\u4f4d\u5b57\u7b26\u7684\u65b0\u5bc6\u7801\uff0c\u533a\u5206\u5927\u5c0f\u5199\uff01"):t():t("\u8bf7\u8f93\u51658-16\u4f4d\u5b57\u7b26\u7684\u65b0\u5bc6\u7801\uff0c\u533a\u5206\u5927\u5c0f\u5199\uff01")},N=function(e){var a,t,c,f,v,N,C,P,k,j,O,x,D,B,z,S=e.user,W=e.account,F=e.globalSetting,R=(e.loading,e.dispatch),V=(Object(d["a"])(e,["user","account","globalSetting","loading","dispatch"]),u["a"].useForm()),q=Object(m["a"])(V,1),Z=q[0],T=Object(p["useState"])(),A=Object(m["a"])(T,2),X=A[0],H=A[1],J=Object(p["useState"])(60),G=Object(m["a"])(J,2),L=G[0],M=G[1],Y=Object(p["useState"])(),$=Object(m["a"])(Y,2),K=$[0],Q=$[1],U=Object(p["useRef"])();Object(p["useEffect"])((function(){return function(){U.current&&clearInterval(U.current)}}),[]),_((function(){K&&(L>0?M(L-1):(M(60),Q(!1),U.current&&clearInterval(U.current)))}),1e3);var ee=function(){var e=Object(i["a"])(l.a.mark((function e(a){var t,n,r,o;return l.a.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!a){e.next=8;break}if(n=3,t=Z.getFieldValue("phone"),w.test(t)){e.next=6;break}return s["b"].info("\u8bf7\u5148\u8f93\u5165\u6b63\u786e\u7684\u624b\u673a\u53f7\u7801"),e.abrupt("return");case 6:e.next=13;break;case 8:if(n=4,t=Z.getFieldValue("email"),y.test(t)){e.next=13;break}return s["b"].info("\u8bf7\u5148\u8f93\u5165\u6b63\u786e\u7684\u90ae\u7bb1\u5730\u5740"),e.abrupt("return");case 13:return r=Object(h["z"])(t),e.next=16,R({type:"account/getCode",payload:{login:t,type:n,smscode:r}});case 16:o=e.sent,1===o.status&&s["b"].info("\u9a8c\u8bc1\u7801\u5df2\u53d1\u9001\uff0c\u8bf7\u6ce8\u610f\u67e5\u6536"),Q(!0);case 19:case"end":return e.stop()}}),e)})));return function(a){return e.apply(this,arguments)}}(),ae=function(){var e=Object(i["a"])(l.a.mark((function e(a){var t,n,r,o,c,i,u;return l.a.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t=a||{},n=t.phone,r=t.phoneValidateCode,o=S.userInfo||{},c=o.login,w.test(n)){e.next=5;break}return s["b"].info("\u8bf7\u8f93\u5165\u6709\u6548\u768411\u4f4d\u624b\u673a\u53f7\u7801"),e.abrupt("return");case 5:return e.next=7,R({type:"account/bindPhone",payload:{login:c,phone:n,code:r}});case 7:i=e.sent,0===(null===i||void 0===i?void 0:i.status)&&(s["b"].info("\u624b\u673a\u53f7\u7801\u7ed1\u5b9a\u6210\u529f!"),H(null),R({type:"account/getBasicInfo",payload:{login:null===(u=S.userInfo)||void 0===u?void 0:u.login}}));case 9:case"end":return e.stop()}}),e)})));return function(a){return e.apply(this,arguments)}}(),te=function(){var e=Object(i["a"])(l.a.mark((function e(a){var t,n,r,o,c,i,u;return l.a.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t=a||{},n=t.email,r=t.emailValidateCode,o=S.userInfo||{},c=o.login,y.test(n)){e.next=5;break}return s["b"].info("\u8bf7\u8f93\u5165\u6b63\u786e\u7684\u90ae\u7bb1\u5730\u5740"),e.abrupt("return");case 5:return e.next=7,R({type:"account/bindEmail",payload:{login:c,email:n,code:r}});case 7:i=e.sent,0===(null===i||void 0===i?void 0:i.status)&&(s["b"].info("\u90ae\u7bb1\u5730\u5740\u7ed1\u5b9a\u6210\u529f!"),H(null),R({type:"account/getBasicInfo",payload:{login:null===(u=S.userInfo)||void 0===u?void 0:u.login}}));case 9:case"end":return e.stop()}}),e)})));return function(a){return e.apply(this,arguments)}}(),ne=function(){var e=Object(i["a"])(l.a.mark((function e(a){var t,n,r,o,c,i,u,m,d;return l.a.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(n=a||{},r=n.oldPassword,o=n.newPassword,c=n.againPassword,i=S.userInfo||{},u=i.login,!(null===(t=W.basicInfo)||void 0===t?void 0:t.has_password)||r!==o){e.next=5;break}return s["b"].info("\u65b0\u5bc6\u7801\u4e0d\u80fd\u4e0e\u65e7\u5bc6\u7801\u76f8\u540c\uff01"),e.abrupt("return");case 5:if(o===c){e.next=8;break}return s["b"].info("\u4e24\u6b21\u8f93\u5165\u7684\u65b0\u5bc6\u7801\u5fc5\u987b\u4e00\u81f4\uff01"),e.abrupt("return");case 8:return e.next=10,R({type:"account/updatePassword",payload:{login:u,old_password:r,password:o}});case 10:m=e.sent,m&&(s["b"].info("\u5bc6\u7801\u66f4\u65b0\u6210\u529f\uff01"),H(null),R({type:"account/getBasicInfo",payload:{login:null===(d=S.userInfo)||void 0===d?void 0:d.login}}));case 12:case"end":return e.stop()}}),e)})));return function(a){return e.apply(this,arguments)}}(),re=function(e){var a=e||{};Object(o["a"])(a),console.log("handleFinish values: ",e),X===g.Phone&&ae(e),X===g.Email&&te(e),X===g.Password&&ne(e)};return b.a.createElement("section",{className:E.a.wrap},b.a.createElement("div",null,b.a.createElement("div",{className:E.a.content},b.a.createElement("div",{className:"".concat(E.a.titleWrap," mt10")},b.a.createElement("div",{className:E.a.title},"\u5b89\u5168\u8bbe\u7f6e")),b.a.createElement(u["a"],{form:Z,className:E.a.formWrap,labelCol:{span:6},wrapperCol:{span:10},onFinish:re},b.a.createElement("div",{className:"".concat(E.a.row," ").concat(X===g.Phone?"":E.a.rowBorder)},b.a.createElement("span",{className:"".concat(E.a.name," ").concat(E.a.color999)},"\u624b\u673a"),b.a.createElement("div",{className:"".concat(E.a.description," ").concat(E.a.colorCDCDCD)},(null===(a=W.basicInfo)||void 0===a?void 0:a.phone)?b.a.createElement("span",{className:"".concat(E.a.status," mr20")},null===(t=W.basicInfo)||void 0===t?void 0:t.phone):b.a.createElement("span",{className:"".concat(E.a.status," ").concat(E.a.colorRed," mr20")},"\u672a\u7ed1\u5b9a"),(null===(c=W.basicInfo)||void 0===c?void 0:c.phone)?"\u4ec5\u81ea\u5df1\u53ef\u89c1\uff0c\u53ef\u7528\u624b\u673a\u53f7\u7801\u767b\u5f55EduCoder":"\u7ed1\u5b9a\u624b\u673a\u53f7\u7801\uff0c\u5c06\u83b7\u5f97500\u91d1\u5e01\u7684\u5956\u52b1\u54df\uff5e\uff0c\u624b\u673a\u53f7\u7801\u4ec5\u81ea\u5df1\u53ef\u89c1~"),X!==g.Phone&&b.a.createElement("span",{className:E.a.active,onClick:function(){return H(g.Phone)}},(null===(f=W.basicInfo)||void 0===f?void 0:f.phone)?"\u66f4\u6362":"\u7acb\u5373\u7ed1\u5b9a")),X===g.Phone&&b.a.createElement(b.a.Fragment,null,b.a.createElement(u["a"].Item,{label:"\u4f60\u7684\u624b\u673a\u53f7",name:"phone",rules:[{required:!0,message:"\u8bf7\u8f93\u5165\u8981".concat((null===(v=W.basicInfo)||void 0===v?void 0:v.phone)?"\u66f4\u6362":"\u7ed1\u5b9a","\u7684\u624b\u673a\u53f7\u7801")},{validator:function(e,a,t){w.test(a)&&t(),t("\u8bf7\u8f93\u5165\u6709\u6548\u768411\u4f4d\u624b\u673a\u53f7\u7801")}}]},b.a.createElement(r["a"],{placeholder:"\u8bf7\u8f93\u5165\u8981".concat((null===(N=W.basicInfo)||void 0===N?void 0:N.phone)?"\u66f4\u6362":"\u7ed1\u5b9a","\u7684\u624b\u673a\u53f7\u7801")})),!(null===F||void 0===F||null===(C=F.setting)||void 0===C?void 0:C.is_local)&&b.a.createElement(u["a"].Item,{label:"\u624b\u673a\u9a8c\u8bc1\u7801"},b.a.createElement(u["a"].Item,{name:"phoneValidateCode",rules:[{required:!0,message:"\u8bf7\u8f93\u5165\u624b\u673a\u83b7\u53d6\u7684\u9a8c\u8bc1\u7801"}],noStyle:!0},b.a.createElement(r["a"],{placeholder:"\u8bf7\u8f93\u5165\u624b\u673a\u83b7\u53d6\u7684\u9a8c\u8bc1\u7801"})),b.a.createElement(n["a"],{type:"primary",className:"ml5",disabled:K,onClick:function(){return ee(!0)}},K?"\u91cd\u65b0\u53d1\u9001".concat(L,"s"):"\u83b7\u53d6\u9a8c\u8bc1\u7801")),b.a.createElement(u["a"].Item,{noStyle:!0},b.a.createElement("div",{className:E.a.buttonWrap},b.a.createElement(n["a"],{className:"".concat(E.a.submitButton),size:"large",type:"primary",htmlType:"submit"},"\u786e\u5b9a"),b.a.createElement(n["a"],{className:E.a.submitButton,size:"large",onClick:function(){return H(null)}},"\u53d6\u6d88")))),b.a.createElement("div",{className:"".concat(E.a.row," ").concat(X===g.Email?"":E.a.rowBorder)},b.a.createElement("span",{className:"".concat(E.a.name," ").concat(E.a.color999)},"\u90ae\u7bb1"),b.a.createElement("div",{className:"".concat(E.a.description," ").concat(E.a.colorCDCDCD)},(null===(P=W.basicInfo)||void 0===P?void 0:P.mail)?b.a.createElement("span",{className:"".concat(E.a.status," mr20")},null===(k=W.basicInfo)||void 0===k?void 0:k.mail):b.a.createElement("span",{className:"".concat(E.a.status," ").concat(E.a.colorRed," mr20")},"\u672a\u7ed1\u5b9a"),"\u90ae\u7bb1\u8d26\u53f7\u4ec5\u81ea\u5df1\u53ef\u89c1\uff0c\u53ef\u7528\u4e8e\u90ae\u7bb1\u8d26\u53f7\u767b\u5f55",!(null===F||void 0===F||null===(j=F.setting)||void 0===j?void 0:j.is_local)&&"EduCoder"),X!==g.Email&&b.a.createElement("span",{className:E.a.active,onClick:function(){return H(g.Email)}},(null===(O=W.basicInfo)||void 0===O?void 0:O.mail)?"\u66f4\u6362":"\u7acb\u5373\u7ed1\u5b9a")),X===g.Email&&b.a.createElement(b.a.Fragment,null,b.a.createElement(u["a"].Item,{label:"\u90ae\u7bb1\u5730\u5740",name:"email",rules:[{required:!0,message:(null===(x=W.basicInfo)||void 0===x?void 0:x.mail)?"\u8bf7\u8f93\u5165\u8981\u66f4\u6362\u7684\u65b0\u90ae\u7bb1\u5730\u5740":"\u8bf7\u8f93\u5165\u90ae\u7bb1\u5730\u5740"}]},b.a.createElement(r["a"],{placeholder:(null===(D=W.basicInfo)||void 0===D?void 0:D.mail)?"\u8bf7\u8f93\u5165\u8981\u66f4\u6362\u7684\u65b0\u90ae\u7bb1\u5730\u5740":"\u8bf7\u8f93\u5165\u90ae\u7bb1\u5730\u5740"})),!(null===F||void 0===F||null===(B=F.setting)||void 0===B?void 0:B.is_local)&&b.a.createElement(u["a"].Item,{label:"\u90ae\u7bb1\u9a8c\u8bc1\u7801"},b.a.createElement(u["a"].Item,{name:"emailValidateCode",rules:[{required:!0,message:"\u8bf7\u8f93\u5165\u90ae\u7bb1\u6536\u5230\u7684\u9a8c\u8bc1\u7801"}],noStyle:!0},b.a.createElement(r["a"],{placeholder:"\u8bf7\u8f93\u5165\u90ae\u7bb1\u6536\u5230\u7684\u9a8c\u8bc1\u7801"})),b.a.createElement(n["a"],{type:"primary",className:"ml5",disabled:K,onClick:function(){return ee(!1)}},K?"\u91cd\u65b0\u53d1\u9001".concat(L,"s"):"\u83b7\u53d6\u9a8c\u8bc1\u7801")),b.a.createElement(u["a"].Item,{noStyle:!0},b.a.createElement("div",{className:E.a.buttonWrap},b.a.createElement(n["a"],{className:"".concat(E.a.submitButton),size:"large",type:"primary",htmlType:"submit"},"\u786e\u5b9a"),b.a.createElement(n["a"],{className:E.a.submitButton,size:"large",onClick:function(){return H(null)}},"\u53d6\u6d88")))),b.a.createElement("div",{className:E.a.row},b.a.createElement("span",{className:"".concat(E.a.name," ").concat(E.a.color999)},"\u5bc6\u7801"),b.a.createElement("div",{className:"".concat(E.a.description," ").concat(E.a.colorCDCDCD)},b.a.createElement("span",{className:"".concat(E.a.status," mr20")},"**********"),"\u7528\u4e8e\u4fdd\u62a4\u8d26\u6237\u4fe1\u606f\u548c\u767b\u5f55\u5b89\u5168"),X!==g.Password&&b.a.createElement("span",{className:E.a.active,onClick:function(){return H(g.Password)}},"\u4fee\u6539")),X===g.Password&&b.a.createElement(b.a.Fragment,null,(null===(z=W.basicInfo)||void 0===z?void 0:z.has_password)&&b.a.createElement(u["a"].Item,{label:"\u65e7\u5bc6\u7801",name:"oldPassword",rules:[{required:!0,message:"\u8bf7\u8bbe\u7f6e8\uff5e16\u4f4d\u5bc6\u7801\uff0c\u533a\u5206\u5927\u5c0f\u5199"}]},b.a.createElement(r["a"],{type:"password",placeholder:"\u8bf7\u8bbe\u7f6e8\uff5e16\u4f4d\u5bc6\u7801\uff0c\u533a\u5206\u5927\u5c0f\u5199"})),b.a.createElement(u["a"].Item,{label:"\u65b0\u5bc6\u7801",name:"newPassword",rules:[{required:!0,message:"\u8bf7\u8bbe\u7f6e8\uff5e16\u4f4d\u5bc6\u7801\uff0c\u533a\u5206\u5927\u5c0f\u5199"},{validator:I}]},b.a.createElement(r["a"],{type:"password",placeholder:"\u8bf7\u8f93\u51658\uff5e16\u4f4d\u7684\u65b0\u5bc6\u7801\uff0c\u533a\u5206\u5927\u5c0f\u5199"})),b.a.createElement(u["a"].Item,{label:"\u518d\u6b21\u8f93\u5165",name:"againPassword",rules:[{required:!0,message:"\u8bf7\u518d\u6b21\u8f93\u5165\u65b0\u5bc6\u7801"},{validator:function(e,a,t){a!=Z.getFieldsValue().newPassword?t("\u4e24\u6b21\u8f93\u5165\u7684\u65b0\u5bc6\u7801\u5fc5\u987b\u4e00\u81f4\uff01"):t()}}]},b.a.createElement(r["a"],{type:"password",placeholder:"\u8bf7\u518d\u6b21\u8f93\u5165\u65b0\u5bc6\u7801"})),b.a.createElement(u["a"].Item,{noStyle:!0},b.a.createElement("div",{className:E.a.buttonWrap},b.a.createElement(n["a"],{className:"".concat(E.a.submitButton),size:"large",type:"primary",htmlType:"submit"},"\u786e\u5b9a"),b.a.createElement(n["a"],{className:E.a.submitButton,size:"large",onClick:function(){return H(null)}},"\u53d6\u6d88")))))),b.a.createElement("div",{className:"".concat(E.a.hint," font14")},"* \u6211\u4eec\u786e\u4fdd\u4f60\u6240\u63d0\u4f9b\u7684\u4fe1\u606f\u5747\u5904\u4e8e\u4e25\u683c\u4fdd\u5bc6\u72b6\u6001\uff0c\u4e0d\u4f1a\u6cc4\u9732")))};a["default"]=Object(f["a"])((function(e){var a=e.user,t=e.account,n=e.loading,r=e.globalSetting;return{user:a,account:t,globalSetting:r,loading:n.models.index}}))(N)},bu1o:function(e,a,t){e.exports={wrap:"wrap___L0XY0",content:"content___1FZI4",hint:"hint___2Mhin",titleWrap:"titleWrap___3-5ea",title:"title___3dpg1",formWrap:"formWrap___1-_oA",row:"row___10m9D",rowBorder:"rowBorder___1KLaz",name:"name___3A1ha",status:"status___jLEgn",description:"description___GYT0j",active:"active___UNwEo",color999:"color999___1O3Pw",colorCDCDCD:"colorCDCDCD___Xw3Dl",colorRed:"colorRed___Tupja",submitButton:"submitButton___1_t-q",buttonWrap:"buttonWrap___Q18CA"}}}]); |