-
Notifications
You must be signed in to change notification settings - Fork 0
/
modify-password.js
1 lines (1 loc) · 5.17 KB
/
modify-password.js
1
webpackJsonp([10],{91:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.MENU=1,t.CONTENT=2,t.ADD=3,t.UPDATE=4,t.DELETE=5,t.DETAIL=6,t.CHECK=7,t.UPLOAD=8,t.STATUS=9},925:function(e,t,a){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var s=a(80),o=r(s),u=a(47),d=a(976),n=a(20);t["default"]={namespace:"systemModifyPassword",state:{},subscriptions:{setup:function(e){var t=e.dispatch,a=e.history;a.listen(function(e){var a=e.pathname;if("/system/modify-password"===a){var r=(0,n.getCurPowers)(a);t(r?{type:"app/changeCurPowers",payload:{curPowers:r}}:u.routerRedux.push({pathname:"/no-power"}))}})}},effects:{update:o["default"].mark(function l(e,t){var a=e.payload,r=(t.select,t.call);t.put;return o["default"].wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r(d.update,a);case 2:case"end":return e.stop()}},l,this)})},reducers:{}},e.exports=t["default"]},965:function(e,t,a){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var s,o,u=(a(29),a(17)),d=r(u),n=a(6),l=r(n),i=(a(52),a(76)),f=r(i),p=a(2),c=r(p),m=a(4),h=r(m),y=a(3),w=r(y),v=(a(151),a(150)),b=r(v),P=a(1),_=r(P),E=a(5),g=r(E),M=a(735),k=r(M),D=a(1205),C=r(D),T=b["default"].Item,F={labelCol:{span:6},wrapperCol:{span:14}},O={wrapperCol:{span:14,offset:6}},x=(o=s=function(e){function t(){var a,r,s;(0,c["default"])(this,t);for(var o=arguments.length,u=Array(o),d=0;d<o;d++)u[d]=arguments[d];return a=r=(0,h["default"])(this,e.call.apply(e,[this].concat(u))),r.state={passwordDirty:!1},s=a,(0,h["default"])(r,s)}return(0,w["default"])(t,e),t.prototype.handleSubmit=function(e){var t=this;e.preventDefault(),this.props.form.validateFields(function(e,a){e||(a.username=k["default"].get("user_name"),t.props.onOk(a))})},t.prototype.checkConfirm=function(e,t,a){t&&this.state.passwordDirty&&this.props.form.validateFields(["confirm"],{force:!0}),a()},t.prototype.handlePasswordBlur=function(e){var t=e.target.value;this.setState({passwordDirty:this.state.passwordDirty||!!t})},t.prototype.checkPassword=function(e,t,a){t&&t!==this.props.form.getFieldValue("password")?a("\u4e24\u4e2a\u65b0\u5bc6\u7801\u8f93\u5165\u4e0d\u4e00\u81f4"):a()},t.prototype.render=function(){var e=this.props,t=e.loading,a=e.form.getFieldDecorator,r=e.updatePower;return _["default"].createElement(b["default"],{className:C["default"].modifyForm,onSubmit:this.handleSubmit.bind(this)},_["default"].createElement(T,(0,l["default"])({label:"\u65e7\u5bc6\u7801\uff1a",hasFeedback:!0},F),a("oldPassword",{rules:[{required:!0,message:"\u8bf7\u8f93\u5165\u65e7\u5bc6\u7801"}]})(_["default"].createElement(f["default"],{placeholder:"\u8bf7\u8f93\u5165\u65e7\u5bc6\u7801",type:"password"}))),_["default"].createElement(T,(0,l["default"])({label:"\u65b0\u5bc6\u7801\uff1a",hasFeedback:!0},F),a("password",{rules:[{required:!0,message:"\u8bf7\u8f93\u5165\u65b0\u5bc6\u7801"},{validator:this.checkConfirm.bind(this)}]})(_["default"].createElement(f["default"],{placeholder:"\u8bf7\u8f93\u5165\u65b0\u5bc6\u7801",type:"password",onBlur:this.handlePasswordBlur.bind(this)}))),_["default"].createElement(T,(0,l["default"])({label:"\u65b0\u5bc6\u7801\u786e\u8ba4\uff1a",hasFeedback:!0},F),a("confirm",{rules:[{required:!0,message:"\u8bf7\u8f93\u5165\u65b0\u5bc6\u7801\u786e\u8ba4"},{validator:this.checkPassword.bind(this)}]})(_["default"].createElement(f["default"],{placeholder:"\u8bf7\u8f93\u5165\u65b0\u5bc6\u7801\u786e\u8ba4",type:"password"}))),_["default"].createElement(T,O,_["default"].createElement(d["default"],{type:"primary",htmlType:"submit",size:"large",className:C["default"].button,loading:t,disabled:!r},"\u786e\u8ba4\u4fee\u6539")))},t}(P.Component),s.propTypes={loading:g["default"].bool,onOk:g["default"].func.isRequired},o);t["default"]=b["default"].create()(x),e.exports=t["default"]},966:function(e,t,a){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function s(e){var t=e.dispatch,a=e.curPowers,r=(e.systemModifyPassword,e.loading),s=(0,c.checkPower)(m.UPDATE,a),o={loading:r,updatePower:s,onOk:function(e){t({type:"systemModifyPassword/update",payload:e})}};return d["default"].createElement("div",null,d["default"].createElement(p["default"],o))}function o(e){var t=e.systemModifyPassword,a=e.loading;return{systemModifyPassword:t,loading:a.models.systemModifyPassword}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(1),d=r(u),n=a(5),l=r(n),i=a(82),f=a(965),p=r(f),c=a(20),m=a(91);a(47);s.propTypes={systemModifyPwd:l["default"].object,dispatch:l["default"].func},t["default"]=(0,i.connect)(o)(s),e.exports=t["default"]},976:function(e,t,a){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0}),t.update=void 0;var s=a(80),o=r(s),u=a(304),d=r(u),n=(t.update=function(){var e=(0,d["default"])(o["default"].mark(function t(e){return o["default"].wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,n.request)("/api/modifyPassword",{method:"put",data:e}));case 1:case"end":return t.stop()}},t,this)}));return function(t){return e.apply(this,arguments)}}(),a(20))},1205:function(e,t){e.exports={modifyForm:"modifyForm___iQWL3",button:"button___3zh1p"}}});