skyline-console/skyline_console/static/auth.bundle.1663167892.js
zhangjingwei 49dca85560 feat: update dist for rc1 release
1. Update dist for rc1 release
2. Update version in the package.json

Change-Id: Iaf7c0f5261f0e89b7a38acc1d2be5482bc2384a2
2022-09-14 23:08:02 +08:00

1 line
24 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([[3],{1190:function(e,t,n){"use strict";var r=n(19),a=n(21);r(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n(413)),i=a(n(1633)),l=e=>(0,o.default)(i.default,e);t.default=l},1429:function(e,t,n){"use strict";var r=n(160),a=n(19),o=n(25),i=n(21);a(t,"__esModule",{value:!0}),t.default=void 0;var l=i(n(57)),s=i(n(81)),d=i(n(62));n(1216);var u=i(n(1217)),f=i(n(409)),c=i(n(36)),m=i(n(559)),p=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=_(t);if(n&&n.has(e))return n.get(e);var r={},i=a&&o;for(var l in e)if("default"!==l&&Object.prototype.hasOwnProperty.call(e,l)){var s=i?o(e,l):null;s&&(s.get||s.set)?a(r,l,s):r[l]=e[l]}r.default=e,n&&n.set(e,r);return r}(n(0)),g=(n(173),i(n(16))),h=i(n(4));function _(e){if("function"!=typeof r)return null;var t=new r,n=new r;return(_=function(e){return e?n:t})(e)}class x extends p.Component{constructor(){super(...arguments),(0,c.default)(this,"renderFormItem",(e=>{var{render:t}=e;return t?t():null})),(0,c.default)(this,"getFormItemRules",(e=>{var{rules:t,required:n=!1,message:r,otherRule:a}=e;if((0,m.default)(e,"rules"))return t;var o={required:n};return r&&(o.message=r),a?[o,a]:[o]})),(0,c.default)(this,"renderFormItems",(()=>{var{formItems:e}=this.props;return(0,l.default)(e).call(e,((e,t)=>{var n,{name:r,hidden:a,dependencies:o=[],className:i,onChange:l,extra:d,label:c}=e,m={name:r,rules:this.getFormItemRules(e),hidden:a,dependencies:o,className:i,extra:d,label:c};return l&&(m.onChange=l),p.default.createElement(u.default.Item,(0,f.default)({},m,{key:(0,s.default)(n="".concat(r,"-")).call(n,t)}),this.renderFormItem(e))}))}))}render(){var e=this.props,{formItems:t,formref:n,className:r}=e,a=(0,d.default)(e,["formItems","formref","className"]);return p.default.createElement(u.default,(0,f.default)({ref:n,className:(0,h.default)(r,"simple-form")},a),this.renderFormItems())}}t.default=x,(0,c.default)(x,"propTypes",{name:g.default.string,className:g.default.string,initialValues:g.default.object,onFinish:g.default.func,size:g.default.string,formItems:g.default.array,formref:g.default.any}),(0,c.default)(x,"defaultProps",{initialValues:{},size:"large",formItems:[],onFinish:e=>{}})},1633:function(e,t,n){"use strict";var r=n(19),a=n(21);r(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n(1634)),i=a(n(1646)),l=a(n(1675)),s="/auth",d=[{path:s,component:o.default,routes:[{path:"".concat(s,"/login"),component:i.default,exact:!0},{path:"".concat(s,"/change-password"),component:l.default,exact:!0}]}];t.default=d},1634:function(e,t,n){"use strict";var r=n(160),a=n(19),o=n(25),i=n(21);a(t,"__esModule",{value:!0}),t.default=t.AuthLayout=void 0;var l=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=g(t);if(n&&n.has(e))return n.get(e);var r={},i=a&&o;for(var l in e)if("default"!==l&&Object.prototype.hasOwnProperty.call(e,l)){var s=i?o(e,l):null;s&&(s.get||s.set)?a(r,l,s):r[l]=e[l]}r.default=e,n&&n.set(e,r);return r}(n(0)),s=n(406),d=i(n(413)),u=i(n(1635)),f=i(n(1641)),c=i(n(1642)),m=i(n(1643)),p=i(n(1644));function g(e){if("function"!=typeof r)return null;var t=new r,n=new r;return(g=function(e){return e?n:t})(e)}class h extends l.Component{constructor(e){super(e),this.routes=e.route.routes}renderRight(){return l.default.createElement("div",{className:p.default.right},l.default.createElement("img",{alt:"",className:p.default["login-full-image"],src:c.default}),l.default.createElement("div",{className:p.default["full-image-front"]}),l.default.createElement("img",{src:m.default,alt:"",className:p.default["login-right-logo"]}))}render(){return l.default.createElement("div",{className:p.default.container},l.default.createElement("div",{className:p.default.left},l.default.createElement("div",{className:p.default.lang},l.default.createElement(u.default,null)),l.default.createElement("div",{className:p.default.main},l.default.createElement("div",{className:p.default.top},l.default.createElement("div",{className:p.default.header},l.default.createElement("img",{alt:"logo",className:p.default.logo,src:f.default}))),(0,d.default)(this.routes))),this.renderRight())}}t.AuthLayout=h;var _=(0,s.inject)("rootStore")((0,s.observer)(h));t.default=_},1635:function(e,t,n){"use strict";var r=n(19),a=n(21);r(t,"__esModule",{value:!0}),t.default=void 0,n(573);var o=a(n(421)),i=a(n(1290));n(1227);var l=a(n(418)),s=a(n(57)),d=(n(173),a(n(234))),u=a(n(0)),f=a(n(4)),c=(n(555),a(n(1639))),{getLocale:m,setLocale:p}=d.default,g=e=>{var{className:t}=e,n=m(),r=["zh-cn","en"],a={"zh-cn":"简体中文",en:"English"},d={"zh-cn":"🇨🇳",en:"🇺🇸"},g=u.default.createElement(l.default,{className:c.default.menu,selectedKeys:[n],onClick:e=>{var{key:t}=e;p(t,!1)}},(0,s.default)(r).call(r,(e=>u.default.createElement(l.default.Item,{key:e},u.default.createElement("span",{role:"img","aria-label":a[e]},d[e])," ",a[e]))));return u.default.createElement(o.default,{overlay:g,placement:"bottomRight"},u.default.createElement("span",{className:(0,f.default)(c.default["drop-down"],t)},u.default.createElement(i.default,null)))};t.default=g},1639:function(e,t,n){var r=n(1640);"string"==typeof r&&(r=[[e.i,r,""]]);var a={hmr:!0,transform:undefined,insertInto:void 0};n(75)(r,a);r.locals&&(e.exports=r.locals)},1640:function(e,t,n){(t=e.exports=n(74)(!1)).push([e.i,".index__menu--25uep .anticon {\n margin-right: 8px;\n}\n.index__menu--25uep .ant-dropdown-menu-item {\n min-width: 160px;\n}\n.index__drop-down--37VUG {\n font-size: 16px;\n line-height: 20px;\n vertical-align: top;\n cursor: pointer;\n}\n.index__drop-down--37VUG > i {\n font-size: 16px !important;\n -webkit-transform: none !important;\n transform: none !important;\n}\n.index__drop-down--37VUG > i svg {\n position: relative;\n top: -1px;\n}\n",""]),t.locals={menu:"index__menu--25uep","drop-down":"index__drop-down--37VUG"}},1641:function(e,t,n){"use strict";n.r(t),t.default=n.p+"asset/image/logo.png"},1642:function(e,t,n){"use strict";n.r(t),t.default=n.p+"asset/image/login-full.1663167892.png"},1643:function(e,t,n){"use strict";n.r(t),t.default=n.p+"asset/image/loginRightLogo.png"},1644:function(e,t,n){var r=n(1645);"string"==typeof r&&(r=[[e.i,r,""]]);var a={hmr:!0,transform:undefined,insertInto:void 0};n(75)(r,a);r.locals&&(e.exports=r.locals)},1645:function(e,t,n){(t=e.exports=n(74)(!1)).push([e.i,".index__container--PLjMT {\n position: relative;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -ms-flex-flow: row;\n flex-flow: row;\n height: 100vh;\n overflow: hidden;\n background-color: #fff;\n}\n.index__container--PLjMT .index__left--1nLBx {\n position: relative;\n width: 576px;\n overflow-y: auto;\n /* TODO wait for RGB\n // background: rgb(253, 249, 252) no-repeat fixed left bottom;\n // background-size: 556px; */\n}\n.index__container--PLjMT .index__left--1nLBx .index__lang--1iG5n {\n position: absolute;\n top: 20px;\n right: 24px;\n width: 20px;\n height: 20px;\n text-align: right;\n}\n.index__container--PLjMT .index__left--1nLBx .index__main--1Zm84 {\n margin-top: 10vh;\n padding: 0 130px;\n}\n.index__container--PLjMT .index__left--1nLBx .index__main--1Zm84 .index__top--2uGv8 {\n text-align: center;\n}\n.index__container--PLjMT .index__left--1nLBx .index__main--1Zm84 .index__top--2uGv8 .index__header--15dtF {\n height: 56px;\n line-height: 56px;\n text-align: left;\n}\n.index__container--PLjMT .index__left--1nLBx .index__main--1Zm84 .index__top--2uGv8 .index__header--15dtF a {\n text-decoration: none;\n}\n.index__container--PLjMT .index__left--1nLBx .index__main--1Zm84 .index__top--2uGv8 .index__header--15dtF .index__logo--2IrMw {\n height: 56px;\n margin-right: 16px;\n vertical-align: top;\n}\n.index__container--PLjMT .index__right--1kgDa {\n position: relative;\n -webkit-box-flex: 1;\n -ms-flex: 1 1;\n flex: 1 1;\n text-align: center;\n background-color: #21242a;\n}\n.index__login-image--1VBMI {\n margin-top: calc(100vh - 668px);\n}\n.index__login-full-image--3lehL {\n width: 100%;\n height: 100%;\n}\n.index__full-image-front--1vn-y {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n background-color: rgba(14, 34, 181, 0.15);\n}\n.index__login-right-logo--31US1 {\n position: relative;\n top: -100px;\n}\n",""]),t.locals={container:"index__container--PLjMT",left:"index__left--1nLBx",lang:"index__lang--1iG5n",main:"index__main--1Zm84",top:"index__top--2uGv8",header:"index__header--15dtF",logo:"index__logo--2IrMw",right:"index__right--1kgDa","login-image":"index__login-image--1VBMI","login-full-image":"index__login-full-image--3lehL","full-image-front":"index__full-image-front--1vn-y","login-right-logo":"index__login-right-logo--31US1"}},1646:function(e,n,r){"use strict";var a=r(33),o=r(44),i=r(32),l=r(25),s=r(27),d=r(45),u=r(46),f=r(19),c=r(160),m=r(21);f(n,"__esModule",{value:!0}),n.default=n.Login=void 0;var p=m(r(427)),g=m(r(198)),h=m(r(57));r(333);var _=m(r(332));r(1198);var x=m(r(1199));r(1196);var v=m(r(1197));r(1205);var w=m(r(1206));r(560);var b=m(r(412)),y=m(r(600)),S=m(r(51)),E=m(r(36)),P=m(r(199)),L=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=N(t);if(n&&n.has(e))return n.get(e);var r={},a=f&&l;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var i=a?l(e,o):null;i&&(i.get||i.set)?f(r,o,i):r[o]=e[o]}r.default=e,n&&n.set(e,r);return r}(r(0)),O=(r(173),r(406)),I=r(201),k=(r(555),m(r(1429))),T=m(r(1672)),R=m(r(234)),M=m(r(1673));function N(e){if("function"!=typeof c)return null;var t=new c,n=new c;return(N=function(e){return e?n:t})(e)}function j(e,t){var n=a(e);if(o){var r=o(e);t&&(r=i(r).call(r,(function(t){return l(e,t).enumerable}))),n.push.apply(n,r)}return n}class F extends L.Component{constructor(e){super(e),(0,E.default)(this,"onLoginTypeChange",((e,t)=>{this.setState({loginTypeOption:t})})),(0,E.default)(this,"getUserId",(e=>{var t;return(0,p.default)(t=e.split(":")[1]).call(t).split(".")[0]})),(0,E.default)(this,"onLoginFailed",((e,t)=>{this.setState({loading:!1});var{data:{detail:n=""}}=e.response,r=n||"";(0,g.default)(r).call(r,"The password is expired and needs to be changed for user")?this.dealWithChangePassword(r,t):this.setState({error:!0,message:r})})),(0,E.default)(this,"onLoginSuccess",(()=>{this.setState({loading:!1,error:!1}),this.rootStore.user&&!(0,P.default)(this.rootStore.user)&&this.rootStore.routing.push(this.nextPage)})),(0,E.default)(this,"onFinish",(e=>{if("sso"!==this.currentLoginType){this.setState({loading:!0,message:"",error:!1});var{domain:t,password:n,region:r,username:a}=e,o={domain:t,password:n,region:r,username:a};this.rootStore.login(o).then((()=>{this.onLoginSuccess()}),(t=>{this.onLoginFailed(t,e)}))}else document.location.href=this.currentSSOLink})),(0,E.default)(this,"dealWithChangePassword",((e,t)=>{var n=this.getUserId(e),r={region:t.region,oldPassword:t.password,userId:n};this.rootStore.setPasswordInfo(r),this.rootStore.routing.push("/auth/change-password")})),(0,E.default)(this,"updateDefaultValue",(()=>{this.formRef.current.resetFields(),this.formRef.current&&this.formRef.current.resetFields&&this.formRef.current.resetFields()})),this.init(),this.state={error:!1,message:"",loading:!1,loginTypeOption:this.passwordOption}}componentDidMount(){this.getDomains(),this.getRegions(),this.getSSO()}getDomains(){var e=this;return(0,S.default)((function*(){yield e.store.fetchDomainList(),e.updateDefaultValue()}))()}getRegions(){var e=this;return(0,S.default)((function*(){yield e.store.fetchRegionList(),e.updateDefaultValue()}))()}getSSO(){var e=this;return(0,S.default)((function*(){try{e.store.fetchSSO()}catch(e){}}))()}get rootStore(){return this.props.rootStore}get info(){var{info:e={}}=this.rootStore;return e||{}}get productName(){var{product_name:{zh:e=t("Cloud Platform"),en:n="Cloud Platform"}={}}=this.info,{isLocaleZh:r}=R.default;return t("Welcome, {name}",{name:r?e:n})}get domains(){var e;return(0,h.default)(e=this.store.domains||[]).call(e,(e=>({label:e,value:e})))}get regions(){var e;return(0,h.default)(e=this.store.regions||[]).call(e,(e=>({label:e,value:e})))}get nextPage(){var{location:e={}}=this.props,{search:t}=e;return t?t.split("=")[1]:"/base/overview"}get enableSSO(){var{sso:{enable_sso:e=!1}={}}=this.store;return e}get ssoProtocols(){return{openid:t("OpenID Connect")}}get SSOOptions(){if(!this.enableSSO)return[];var{sso:{protocols:e=[]}={}}=this.store;return(0,h.default)(e).call(e,(e=>{var{protocol:t,url:n}=e;return function(e){for(var t=1;t<arguments.length;t++){var n,r=null!=arguments[t]?arguments[t]:{};if(t%2)s(n=j(Object(r),!0)).call(n,(function(t){(0,E.default)(e,t,r[t])}));else if(d)u(e,d(r));else{var a;s(a=j(Object(r))).call(a,(function(t){f(e,t,l(r,t))}))}}return e}({label:this.ssoProtocols[t]||t,value:n},e)}))}get passwordOption(){return{label:t("Keystone Credentials"),value:"password"}}get loginTypeOptions(){return this.enableSSO?[this.passwordOption,...this.SSOOptions]:[]}get currentLoginType(){var{loginTypeOption:{value:e}={}}=this.state;return"password"===e?"password":"sso"}get currentSSOLink(){var{loginTypeOption:{value:e}={}}=this.state;return e}get defaultValue(){var e={loginType:"password"};return 1===this.regions.length&&(e.region=this.regions[0].value),1===this.domains.length&&(e.domain=this.domains[0].value),e}get formItems(){var{error:e,loading:n}=this.state,r=this.currentLoginType,a={name:"submit",render:()=>L.default.createElement(x.default,{gutter:8},L.default.createElement(v.default,{span:12},L.default.createElement(_.default,{loading:n,type:"primary",htmlType:"submit",className:"login-form-button"},t("Log in"))))},o=[{name:"error",hidden:!e,render:()=>L.default.createElement("div",{className:M.default["login-error"]},L.default.createElement(y.default,null),this.getErrorMessage())},{name:"region",required:!0,message:t("Please select your Region!"),render:()=>L.default.createElement(b.default,{placeholder:t("Select a region"),options:this.regions})},{name:"domain",required:!0,message:t("Please select your Domain!"),render:()=>L.default.createElement(b.default,{placeholder:t("Select a domain"),options:this.domains})},{name:"username",required:!0,message:t("Please input your Username!"),render:()=>L.default.createElement(w.default,{placeholder:t("Username")})},{name:"password",required:!0,message:t("Please input your Password!"),render:()=>L.default.createElement(w.default.Password,{placeholder:t("Password")})},{name:"extra",hidden:!0,render:()=>L.default.createElement(x.default,{gutter:8},L.default.createElement(v.default,{span:12},L.default.createElement(I.Link,{to:"password"},t("Forgot your password?"))),L.default.createElement(v.default,{span:12},L.default.createElement(I.Link,{to:"register",className:M.default.register},t("Sign up"))))}],i={name:"loginType",required:!0,message:t("Please select login type!"),extra:t("If you are not sure which authentication method to use, please contact your administrator."),render:()=>L.default.createElement(b.default,{placeholder:t("Select a login type"),options:this.loginTypeOptions,onChange:this.onLoginTypeChange})};return this.enableSSO?"password"===r?[i,...o,a]:[i,a]:[...o,a]}getErrorMessage(){var{message:e}=this.state;return(0,g.default)(e).call(e,"The account is locked for user")?t("Frequent login failure will cause the account to be temporarily locked, please operate after 5 minutes"):(0,g.default)(e).call(e,"The account is disabled for user")?t("The user has been disabled, please contact the administrator"):(0,g.default)(e).call(e,"You are not authorized for any projects or domains")?t("If you are not authorized to access any project, or if the project you are involved in has been deleted or disabled, contact the platform administrator to reassign the project"):t("Username or password is incorrect")}init(){this.store=T.default,this.formRef=L.default.createRef()}renderExtra(){return null}render(){return L.default.createElement(L.default.Fragment,null,L.default.createElement("h1",{className:M.default.welcome},this.productName),L.default.createElement(k.default,{formItems:this.formItems,name:"normal_login",className:M.default["login-form"],initialValues:this.defaultValue,onFinish:this.onFinish,formref:this.formRef,size:"large"}),this.renderExtra())}}n.Login=F;var z=(0,O.inject)("rootStore")((0,O.observer)(F));n.default=z},1672:function(e,t,n){"use strict";var r=n(19),a=n(21);r(t,"__esModule",{value:!0}),t.default=t.SkylineStore=void 0;var o,i,l,s,d=a(n(25)),u=a(n(51)),f=a(n(71)),c=(a(n(36)),a(n(54))),m=(a(n(72)),n(34)),p=a(n(48)),g=a(n(53)),h=(o=class extends g.default{constructor(){super(...arguments),(0,f.default)(this,"domains",i,this),(0,f.default)(this,"regions",l,this),(0,f.default)(this,"sso",s,this)}get client(){return p.default.skyline.contrib}fetchDomainList(){var e=this;return(0,u.default)((function*(){var t=yield e.client.domains();e.domains=t}))()}fetchRegionList(){var e=this;return(0,u.default)((function*(){var t=yield e.client.regions();e.regions=t}))()}fetchSSO(){var e=this;return(0,u.default)((function*(){var t=yield p.default.skyline.sso.list();e.sso=t}))()}},i=(0,c.default)(o.prototype,"domains",[m.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),l=(0,c.default)(o.prototype,"regions",[m.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),s=(0,c.default)(o.prototype,"sso",[m.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{}}}),(0,c.default)(o.prototype,"fetchDomainList",[m.action],(0,d.default)(o.prototype,"fetchDomainList"),o.prototype),(0,c.default)(o.prototype,"fetchRegionList",[m.action],(0,d.default)(o.prototype,"fetchRegionList"),o.prototype),(0,c.default)(o.prototype,"fetchSSO",[m.action],(0,d.default)(o.prototype,"fetchSSO"),o.prototype),o);t.SkylineStore=h;var _=new h;t.default=_},1673:function(e,t,n){var r=n(1674);"string"==typeof r&&(r=[[e.i,r,""]]);var a={hmr:!0,transform:undefined,insertInto:void 0};n(75)(r,a);r.locals&&(e.exports=r.locals)},1674:function(e,t,n){(t=e.exports=n(74)(!1)).push([e.i,".index__register--2dPww {\n float: right;\n}\n.index__welcome--Wrl8u {\n margin-top: 24px;\n margin-bottom: 24px;\n}\n.index__login-form--2ucoo {\n width: 310px;\n}\n.index__login-error--2XGt4 {\n padding: 8px 12px;\n color: #a43a39;\n font-size: 14px;\n line-height: 1.5;\n background: #f2dede;\n border: 1px solid #a43a39;\n border-radius: 4px;\n}\n.index__login-error--2XGt4 .anticon {\n margin-right: 8px;\n}\n",""]),t.locals={register:"index__register--2dPww",welcome:"index__welcome--Wrl8u","login-form":"index__login-form--2ucoo","login-error":"index__login-error--2XGt4"}},1675:function(e,n,r){"use strict";var a=r(160),o=r(19),i=r(25),l=r(21);o(n,"__esModule",{value:!0}),n.default=n.Password=void 0;var s=l(r(90));r(333);var d=l(r(332));r(1205);var u=l(r(1206)),f=l(r(600)),c=l(r(36)),m=l(r(199)),p=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=S(t);if(n&&n.has(e))return n.get(e);var r={},a=o&&i;for(var l in e)if("default"!==l&&Object.prototype.hasOwnProperty.call(e,l)){var s=a?i(e,l):null;s&&(s.get||s.set)?o(r,l,s):r[l]=e[l]}r.default=e,n&&n.set(e,r);return r}(r(0)),g=(r(173),r(201)),h=(r(555),r(556)),_=r(406),x=r(34),v=l(r(1207)),w=l(r(1228)),b=l(r(1429)),y=l(r(1702));function S(e){if("function"!=typeof a)return null;var t=new a,n=new a;return(S=function(e){return e?n:t})(e)}class E extends p.Component{constructor(e){super(e),(0,c.default)(this,"formRef",null),(0,c.default)(this,"onFinish",(e=>{var{rootStore:n}=this.props,{userId:r,oldPassword:a}=this.passwordData,{password:o}=e,i={id:r,password:o,original_password:a};this.setState({loading:!0}),v.default.changePasswordUser(i).then((()=>{this.setState({loading:!1}),w.default.success(t("Password changed successfully, please log in again.")),n.setPasswordInfo(null),n.routing.push("/auth/login")}),(e=>{var{reason:{message:t}}=e;this.setState({error:!0,message:t,loading:!1})}))})),(0,c.default)(this,"getCount",(e=>{try{return e.split("be unique is ")[1].split(".")[0]}catch(e){return 0}})),(0,c.default)(this,"getErrorWord",(e=>{if(!e)return t("Reset failed, please retry");if((0,s.default)(e).call(e,"The new password cannot be identical to a previous password.")>=0){var n=this.getCount(e);return n?"2"===n?t("The password must not be the same as the previous two"):t("The password must not be the same as the previous {num}",{num:n}):t("The password must not be the same as the previous")}return t("Reset failed, please retry")})),this.init(),this.state={error:!1,message:"",loading:!1}}componentDidMount(){var{rootStore:{routing:e}={}}=this.props;this.passwordData&&!(0,m.default)(this.passwordData)||e.push("/auth/login")}componentWillUnmount(){var{rootStore:e}=this.props;e.setPasswordInfo(null)}get passwordData(){var{rootStore:{oldPassword:e}={}}=this.props;return(0,x.toJS)(e)||{}}get defaultValue(){var{oldPassword:e}=this.passwordData;return{oldPassword:e}}get formItems(){var{error:e,message:n,loading:r}=this.state,a=this.getErrorWord(n);return[{name:"hint",render:()=>p.default.createElement("div",{className:y.default.hint},p.default.createElement(f.default,{style:{color:"#FAAD14"}}),t("User need to change password"))},{name:"error",hidden:!e,render:()=>p.default.createElement("div",{className:y.default.error},p.default.createElement(f.default,null),a)},{name:"password",required:!0,message:t("Please input your password!"),otherRule:(0,h.getPasswordOtherRule)("password","user",!0),render:()=>p.default.createElement(u.default.Password,{placeholder:t("Password")})},{name:"confirmPassword",required:!0,message:t("Please confirm your password!"),dependencies:["password"],otherRule:(0,h.getPasswordOtherRule)("confirmPassword","user",!0),render:()=>p.default.createElement(u.default.Password,{placeholder:t("Confirm Password")})},{name:"submit",className:y.default.between,render:()=>p.default.createElement(p.default.Fragment,null,p.default.createElement(d.default,{type:"primary",htmlType:"submit",loading:r},t("Confirm")),p.default.createElement(g.Link,{style:{marginLeft:50},to:"/auth/login"},t("Back to login page")))}]}init(){this.formRef=p.default.createRef()}render(){return p.default.createElement(p.default.Fragment,null,p.default.createElement("h1",{className:y.default.welcome},t("Welcome")),p.default.createElement(b.default,{formref:this.formRef,formItems:this.formItems,name:"reset_password",className:y.default.reset,onFinish:this.onFinish,initialValues:this.defaultValue,size:"large",scrollToFirstError:!0}))}}n.Password=E;var P=(0,_.inject)("rootStore")((0,_.observer)(E));n.default=P},1702:function(e,t,n){var r=n(1703);"string"==typeof r&&(r=[[e.i,r,""]]);var a={hmr:!0,transform:undefined,insertInto:void 0};n(75)(r,a);r.locals&&(e.exports=r.locals)},1703:function(e,t,n){(t=e.exports=n(74)(!1)).push([e.i,".index__register--3Uzk2 {\n float: right;\n}\n.index__welcome--3RISd {\n margin-top: 24px;\n margin-bottom: 24px;\n}\n.index__hint--1lIUh {\n padding: 8px 12px;\n color: rgba(0, 0, 0, 0.65);\n font-size: 14px;\n line-height: 1.5;\n background: #fffbe6;\n border: 1px solid #ffe58f;\n border-radius: 4px;\n}\n.index__hint--1lIUh .anticon {\n margin-right: 8px;\n}\n.index__reset--1EOoE {\n margin-top: 24px;\n}\n.index__reset--1EOoE .index__title--2znQU {\n margin-bottom: 24px;\n}\n.index__reset--1EOoE .index__info--3bS5M {\n margin-bottom: 24px;\n}\n.index__reset--1EOoE .index__between--10sD1 .ant-form-item-control-input-content {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: justify;\n -ms-flex-pack: justify;\n justify-content: space-between;\n}\n.index__error--SAQ5q {\n padding-left: 12px;\n color: #a43a39;\n font-size: 14px;\n line-height: 38px;\n background: #f2dede;\n border: 1px solid #a43a39;\n border-radius: 4px;\n}\n.index__error--SAQ5q .anticon {\n margin-right: 8px;\n}\n",""]),t.locals={register:"index__register--3Uzk2",welcome:"index__welcome--3RISd",hint:"index__hint--1lIUh",reset:"index__reset--1EOoE",title:"index__title--2znQU",info:"index__info--3bS5M",between:"index__between--10sD1",error:"index__error--SAQ5q"}}}]);