-
Notifications
You must be signed in to change notification settings - Fork 450
/
Copy path154da8.236.min.js
1 lines (1 loc) · 4.36 KB
/
154da8.236.min.js
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[236],{1748:function(e,t,a){"use strict";a.d(t,"b",(function(){return n})),a.d(t,"c",(function(){return s})),a.d(t,"a",(function(){return u}));var r=a(12),n=function(e,t){if(e)if(e.length<4&&t(Object(r.g)("用户名不少于4个字符")),e.length>16)t(Object(r.g)("用户名不超过16个字符"));else{/^[\u4e00-\u9fa5a-zA-Z0-9]+$/.test(e)||t(Object(r.g)("仅支持英文、汉字、数字,不支持特殊字符"))}},s=function(e,t){if(e)if(e.length<8)t(Object(r.g)("密码不少于8个字符"));else if(e.length>30)t(Object(r.g)("密码不超过30个字符"));else{/(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*()+=-\?;,./{}|\":<>\[\]\\\' ~_`]).{8,30}/.test(e)||t(Object(r.g)("必须包含大小英文字母、数字和特殊字符"))}},l=a(50),c=a.n(l),i=a(1505),o=a.n(i),u=function(e,t){try{if(null!=e&&e.includes("/")){var a=e.split("/"),n=c()(a,2),s=n[0],l=n[1];if(!s)return void t(Object(r.g)("非法IP地址段"));if(!o.a.isV4Format(s)&&!o.a.isV6Format(s))return void t(Object(r.g)("非法IP地址段"));if(Number(l)<16||Number(l)>32)return void t(Object(r.g)("子网掩码仅支持16-32"))}else if(!o.a.isV4Format(e)&&!o.a.isV6Format(e))return void t(Object(r.g)("非法IP地址"))}catch(e){t(Object(r.g)("非法IP地址"))}}},482:function(e,t,a){"use strict";a.r(t);a(197);var r,n=a(117),s=(a(224),a(97)),l=a(28),c=a.n(l),i=a(50),o=a.n(i),u=(a(806),a(199)),d=a(603),m=a.n(d),b=a(16),f=a.n(b),p=a(0),g=a.n(p),w=a(604),O=a(613),j=a(56),N=a(12),_=a(74),h=a(1748),v=a(166),x="/opt/tiger/compile_path/src/code.byted.org/biz-platform/hids/src/pages/user/edit-password-modal/index.tsx",E=Object(w.a)(u.a)(r||(r=m()(["\n /* .arco-form-label-item > label {\n padding-left: 4px !important;\n } */\n"]))),F={old_password:"",password:"",re_password:""};t.default=function(e){var t=e.visible,a=e.data,r=e.handleCancel,l=u.a.useForm(),i=o()(l,1)[0],d=Object(p.useState)(1),m=o()(d,2),b=m[0],w=m[1];Object(p.useEffect)((function(){t&&(i.setFieldsValue(F),w(1))}),[t]);var P=function(){var e=c()(f.a.mark((function e(){var t,r;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.validate();case 2:if(t=e.sent,1!==b){e.next=10;break}return e.next=6,Object(j.CheckUserPassword)({data:{username:a.username,password:t.old_password}});case 6:null!=(r=e.sent)&&r.data.if_check?w(2):i.setFields({old_password:{value:t.old_password,error:{message:Object(N.g)("密码错误")}}}),e.next=16;break;case 10:return e.next=12,Object(j.UpdateUserPassword)({data:{username:a.username,password:t.password}});case 12:Object(_.b)(),Object(_.e)(),s.a.success(Object(N.g)("修改密码成功,请重新登录")),setTimeout((function(){location.href="".concat(v.a,"/user/login")}),1e3);case 16:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return g.a.createElement(O.b,{visible:t,onCancel:r,onOk:P,style:{width:520},title:Object(N.g)("编辑密码"),__source:{fileName:x,lineNumber:83,columnNumber:5}},g.a.createElement(E,{initialValues:F,form:i,colon:!1,labelAlign:"right",labelCol:{span:N.d?7:4},wrapperCol:{span:N.d?17:20},__source:{fileName:x,lineNumber:90,columnNumber:7}},1===b&&g.a.createElement(u.a.Item,{field:"old_password",label:Object(N.g)("原密码"),rules:[{required:!0,message:Object(N.g)("请确认密码")}],__source:{fileName:x,lineNumber:103,columnNumber:11}},g.a.createElement(n.a.Password,{style:{width:"300px"},placeholder:Object(N.g)("请再次输入密码"),__source:{fileName:x,lineNumber:113,columnNumber:13}})),2===b&&g.a.createElement(g.a.Fragment,null,g.a.createElement(u.a.Item,{field:"password",label:Object(N.g)("密码"),rules:[{required:!0,message:Object(N.g)("请输入密码")},{validator:h.c}],__source:{fileName:x,lineNumber:118,columnNumber:13}},g.a.createElement(n.a.Password,{style:{width:"300px"},placeholder:Object(N.g)("密码需包含大小写英文、数字,不少于8个字符"),__source:{fileName:x,lineNumber:131,columnNumber:15}})),g.a.createElement(u.a.Item,{field:"re_password",label:Object(N.g)("确认密码"),rules:[{required:!0,message:Object(N.g)("请确认密码")},{validator:function(e,t){e!==i.getFieldValue("password")&&t(Object(N.g)("二次确认密码不正确"))}}],__source:{fileName:x,lineNumber:136,columnNumber:13}},g.a.createElement(n.a.Password,{style:{width:"300px"},placeholder:Object(N.g)("请再次输入密码"),__source:{fileName:x,lineNumber:154,columnNumber:15}})))))}}}]);