main.js
16.4 KB
webpackJsonp([7],{1122:function(e,n,t){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,n,t,o){t&&(0,w.default)(e,n,{enumerable:t.enumerable,configurable:t.configurable,writable:t.writable,value:t.initializer?t.initializer.call(o):void 0})}function r(e,n,t,o,i){var r={};return Object.keys(o).forEach(function(e){r[e]=o[e]}),r.enumerable=!!r.enumerable,r.configurable=!!r.configurable,("value"in r||r.initializer)&&(r.writable=!0),r=t.slice().reverse().reduce(function(t,o){return o(e,n,t)||t},r),i&&void 0!==r.initializer&&(r.value=r.initializer?r.initializer.call(i):void 0,r.initializer=void 0),void 0===r.initializer&&(Object.defineProperty(e,n,r),r=null),r}Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var s,a,u,l,c,d,f,p,b,h,m,v,y,g=t(20),w=o(g),C=t(91),S=o(C),M=t(51),A=o(M),E=t(27),z=o(E),P=t(10),I=o(P),k=t(1),B=o(k),O=t(13),R=t(145),x=(s=function e(n){(0,B.default)(this,e),i(this,"accountLogin",a,this),i(this,"loading",u,this),i(this,"hasError",l,this),i(this,"errorMsg",c,this),i(this,"account",d,this),i(this,"password",f,this),i(this,"rememberAccount",p,this),i(this,"rememberPassword",b,this),i(this,"setState",h,this),i(this,"loginSuccess",m,this),i(this,"loginFail",v,this),i(this,"doLogin",y,this),I.default.ls.getStr("emMobileAccount")&&(this.account=R.Base64.decode(I.default.ls.getStr("emMobileAccount")),I.default.ls.getStr("emMobilePassword")&&(this.password=R.Base64.decode(I.default.ls.getStr("emMobilePassword"))))},a=r(s.prototype,"accountLogin",[O.observable],{enumerable:!0,initializer:function(){return!1}}),u=r(s.prototype,"loading",[O.observable],{enumerable:!0,initializer:function(){return!0}}),l=r(s.prototype,"hasError",[O.observable],{enumerable:!0,initializer:function(){return!1}}),c=r(s.prototype,"errorMsg",[O.observable],{enumerable:!0,initializer:function(){return""}}),d=r(s.prototype,"account",[O.observable],{enumerable:!0,initializer:function(){return""}}),f=r(s.prototype,"password",[O.observable],{enumerable:!0,initializer:function(){return""}}),p=r(s.prototype,"rememberAccount",[O.observable],{enumerable:!0,initializer:function(){return!0}}),b=r(s.prototype,"rememberPassword",[O.observable],{enumerable:!0,initializer:function(){return!0}}),h=r(s.prototype,"setState",[O.action],{enumerable:!0,initializer:function(){var e=this;return function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,z.default)(n).forEach(function(t){e[t]=n[t]})}}}),m=r(s.prototype,"loginSuccess",[O.action],{enumerable:!0,initializer:function(){return function(){A.default.hide(),A.default.info("\u767b\u5f55\u6210\u529f",2,function(){window.e9ssoMobileConfig&&window.e9ssoMobileConfig.inUse&&window.e9ssoMobileConfig.homePageUrl?window.location.href=window.e9ssoMobileConfig.homePageUrl:window.location.href="/spa/em/mobile.html"})}}}),v=r(s.prototype,"loginFail",[O.action],{enumerable:!0,initializer:function(){return function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];A.default.hide(),A.default.info("\u767b\u5f55\u5931\u8d25")}}}),y=r(s.prototype,"doLogin",[O.action],{enumerable:!0,initializer:function(){var e=this;return function(){e.rememberAccount?I.default.ls.set("emMobileAccount",R.Base64.encode((0,O.toJS)(e.account))):I.default.ls.set("emMobileAccount",""),e.rememberPassword?I.default.ls.set("emMobilePassword",R.Base64.encode((0,O.toJS)(e.password))):I.default.ls.set("emMobilePassword","");var n="/api/integration/simplesso/getToken",t={loginInfo:(0,S.default)({type:"1",username:(0,O.toJS)(e.account),password:(0,O.toJS)(e.password),idcard:"",devid:""})};window.e9ssoMobileConfig&&window.e9ssoMobileConfig.inUse&&window.e9ssoMobileConfig.loginType&&"commonSession"!==window.e9ssoMobileConfig.loginType||(n="/api/hrm/login/checkLogin",t={loginid:(0,O.toJS)(e.account),userpassword:(0,O.toJS)(e.password),logintype:1,isie:!1}),I.default.callApi({url:n,method:"POST",params:t}).then(function(n){if(window.e9ssoMobileConfig&&window.e9ssoMobileConfig.inUse&&window.e9ssoMobileConfig.loginType&&"commonSession"!==window.e9ssoMobileConfig.loginType)if(1==n.status){if(!n.ssoToken)return void e.loginFail();I.default.ls.set("customSessionKey",{keyName:"ssoToken",keyValue:n.ssoToken}),window.e9ssoMobileConfig&&window.e9ssoMobileConfig.inUse&&window.e9ssoMobileConfig.loginType&&"session"===window.e9ssoMobileConfig.loginType?I.default.callApi({url:"/api/integration/simplesso/getUser",method:"POST",params:{ssoToken:n.ssoToken}}).then(function(n){1==n.status?e.loginSuccess():e.loginFail()}):e.loginSuccess()}else e.loginFail();else"true"==n.loginstatus?e.loginSuccess():e.loginFail()}).catch(function(e){A.default.hide(),A.default.info((0,S.default)(e))})}}}),s);n.default=x},1123:function(e,n,t){"use strict";t(1124),t(1125),t(1126),t(1127),t(1128),t(1129)},1124:function(e,n){},1125:function(e,n){},1126:function(e,n){},1127:function(e,n){},1128:function(e,n){},1129:function(e,n){},724:function(e,n,t){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}var i=t(0),r=o(i),s=t(17),a=t(9),u=t(11),l=t(725),c=t(726),d=o(c);t(1123);var f={LongchengLogin:(0,l.asyncComponent)({resolve:function(){return t.e(4).then(t.bind(null,1255))}}),Login:(0,l.asyncComponent)({resolve:function(){return t.e(5).then(t.bind(null,1256))}})},p=function(){return r.default.createElement(a.Provider,d.default,r.default.createElement(u.HashRouter,null,r.default.createElement(u.Route,{name:"home",path:"/",render:function(e){return r.default.createElement(u.Switch,null,r.default.createElement(u.Route,{name:"longcheng",path:"/longcheng-login",component:f.LongchengLogin}),r.default.createElement(u.Route,{name:"login",path:"/login",component:f.Login}),r.default.createElement(u.Redirect,{to:"/login"}))}})))};(0,s.render)(r.default.createElement(p,null),document.getElementById("root"))},725:function(e,n,t){"use strict";function o(e){return e&&"object"===typeof e&&"default"in e?e.default:e}function i(e){var n,t,o=e.name,i=e.resolve,r=e.autoResolveES2015Default,d=void 0===r||r,h=e.serverMode,m=void 0===h?"resolve":h,y=e.LoadingComponent,g=e.ErrorComponent;if(-1===v.indexOf(m))throw new Error("Invalid serverMode provided to asyncComponent");var w=["node","browser"].indexOf(e.env)>-1?e.env:"undefined"===typeof window?"node":"browser",C={id:null,module:null,error:null,resolver:null,resolving:!1,asyncComponents:null,asyncComponentsAncestor:null},S=function(){return null==C.module&&null==C.error&&!C.resolving&&"undefined"!==typeof window},M=function(e){return d&&null!=e&&("function"===typeof e||"object"===("undefined"===typeof e?"undefined":u(e)))&&e.default?e.default:e},A=function(){if(null==C.resolver){C.resolving=!0;try{C.resolver=Promise.resolve(i())}catch(e){C.resolver=Promise.reject(e)}}return C.resolver};return t=n=function(e){function n(){return l(this,n),b(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return p(n,e),c(n,[{key:"getChildContext",value:function(){return{asyncComponentsAncestor:null==C.asyncComponents?null:{isBoundary:"boundary"===m}}}},{key:"componentWillMount",value:function(){null!=this.context.asyncComponents&&(C.asyncComponents=this.context.asyncComponents,C.asyncComponentsAncestor=this.context.asyncComponentsAncestor,C.id||(C.id=this.context.asyncComponents.getNextId()))}},{key:"bootstrap",value:function(){var e=this,n=function(){return e.resolveModule().then(function(e){return void 0!==e&&void 0})};if("browser"===w){var t=C.asyncComponents,o=t.shouldRehydrate,i=t.getError,r=i(C.id);return r?(C.error=r,!1):!!o(C.id)&&n()}var s=null!=C.asyncComponentsAncestor&&C.asyncComponentsAncestor.isBoundary;return"defer"!==m&&!s&&n()}},{key:"componentDidMount",value:function(){S()&&this.resolveModule()}},{key:"resolveModule",value:function(){var e=this;return A().then(function(e){return null!=C.asyncComponents&&C.asyncComponents.resolved(C.id),C.module=e,C.error=null,C.resolving=!1,e}).catch(function(e){var n=e.message,t=e.stack,o={message:n,stack:t};null!=C.asyncComponents&&C.asyncComponents.failed(C.id,o),C.error=o,C.resolving=!1,g||console.error(o)}).then(function(n){if(!e.unmounted)return e.context.reactAsyncBootstrapperRunning||"browser"!==w||e.forceUpdate(),n})}},{key:"componentWillUnmount",value:function(){this.unmounted=!0}},{key:"render",value:function(){var e=C.module,n=C.error;if(n)return g?s.createElement(g,f({},this.props,{error:n})):null;var t=M(e);return t?s.createElement(t,this.props):y?s.createElement(y,this.props):null}}]),n}(s.Component),n.displayName=o||"AsyncComponent",n.contextTypes={asyncComponentsAncestor:a.shape({isBoundary:a.bool}),asyncComponents:a.shape({getNextId:a.func.isRequired,resolved:a.func.isRequired,shouldRehydrate:a.func.isRequired})},n.childContextTypes={asyncComponentsAncestor:a.shape({isBoundary:a.bool})},t}Object.defineProperty(n,"__esModule",{value:!0});var r=t(0),s=o(r),a=o(t(16)),u="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l=function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")},c=function(){function e(e,n){for(var t=0;t<n.length;t++){var o=n[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(n,t,o){return t&&e(n.prototype,t),o&&e(n,o),n}}(),d=function(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e},f=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},p=function(e,n){if("function"!==typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(e,n):e.__proto__=n)},b=function(e,n){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!==typeof n&&"function"!==typeof n?e:n},h=function(){var e=0,n={},t={};return{getNextId:function(){return e+=1},resolved:function(e){n[e]=!0},failed:function(e,n){t[e]=n},getState:function(){return{resolved:Object.keys(n).reduce(function(e,n){return Object.assign(e,d({},n,!0))},{}),errors:t}}}},m=function(e){function n(){return l(this,n),b(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return p(n,e),c(n,[{key:"componentWillMount",value:function(){this.asyncContext=this.props.asyncContext||h(),this.rehydrateState=this.props.rehydrateState}},{key:"getChildContext",value:function(){var e=this;return{asyncComponents:{getNextId:this.asyncContext.getNextId,resolved:this.asyncContext.resolved,failed:this.asyncContext.failed,shouldRehydrate:function(n){var t=e.rehydrateState.resolved[n];return delete e.rehydrateState.resolved[n],t},getError:function(n){return e.rehydrateState.errors&&e.rehydrateState.errors[n]}}}}},{key:"render",value:function(){return s.Children.only(this.props.children)}}]),n}(r.Component);m.propTypes={children:a.node.isRequired,asyncContext:a.shape({getNextId:a.func.isRequired,resolved:a.func.isRequired,failed:a.func.isRequired,getState:a.func.isRequired}),rehydrateState:a.shape({resolved:a.object})},m.defaultProps={asyncContext:void 0,rehydrateState:{resolved:{}}},m.childContextTypes={asyncComponents:a.shape({getNextId:a.func.isRequired,resolved:a.func.isRequired,failed:a.func.isRequired,shouldRehydrate:a.func.isRequired,getError:a.func.isRequired}).isRequired};var v=["resolve","defer","boundary"];n.AsyncComponentProvider=m,n.createAsyncContext=h,n.asyncComponent=i},726:function(e,n,t){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0});var i=t(727),r=o(i),s=t(1122),a=o(s);n.default={longchengStore:new r.default,loginStore:new a.default}},727:function(e,n,t){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,n,t,o){t&&(0,w.default)(e,n,{enumerable:t.enumerable,configurable:t.configurable,writable:t.writable,value:t.initializer?t.initializer.call(o):void 0})}function r(e,n,t,o,i){var r={};return Object.keys(o).forEach(function(e){r[e]=o[e]}),r.enumerable=!!r.enumerable,r.configurable=!!r.configurable,("value"in r||r.initializer)&&(r.writable=!0),r=t.slice().reverse().reduce(function(t,o){return o(e,n,t)||t},r),i&&void 0!==r.initializer&&(r.value=r.initializer?r.initializer.call(i):void 0,r.initializer=void 0),void 0===r.initializer&&(Object.defineProperty(e,n,r),r=null),r}Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var s,a,u,l,c,d,f,p,b,h,m,v,y,g=t(20),w=o(g),C=t(51),S=o(C),M=t(91),A=o(M),E=t(10),z=o(E),P=t(27),I=o(P),k=t(50),B=o(k),O=t(1),R=o(O),x=t(13),_=(s=function e(){(0,R.default)(this,e),i(this,"accountLogin",a,this),i(this,"loading",u,this),i(this,"hasError",l,this),i(this,"errorMsg",c,this),i(this,"account",d,this),i(this,"password",f,this),i(this,"idNumber",p,this),i(this,"deviceId",b,this),i(this,"browser",h,this),i(this,"browserValue",m,this),i(this,"setState",v,this),i(this,"doLogin",y,this)},a=r(s.prototype,"accountLogin",[x.observable],{enumerable:!0,initializer:function(){return!1}}),u=r(s.prototype,"loading",[x.observable],{enumerable:!0,initializer:function(){return!0}}),l=r(s.prototype,"hasError",[x.observable],{enumerable:!0,initializer:function(){return!1}}),c=r(s.prototype,"errorMsg",[x.observable],{enumerable:!0,initializer:function(){return""}}),d=r(s.prototype,"account",[x.observable],{enumerable:!0,initializer:function(){return""}}),f=r(s.prototype,"password",[x.observable],{enumerable:!0,initializer:function(){return""}}),p=r(s.prototype,"idNumber",[x.observable],{enumerable:!0,initializer:function(){return""}}),b=r(s.prototype,"deviceId",[x.observable],{enumerable:!0,initializer:function(){return""}}),h=r(s.prototype,"browser",[x.observable],{enumerable:!0,initializer:function(){return new B.default.Store({route:"/longcheng-login"})}}),m=r(s.prototype,"browserValue",[x.observable],{enumerable:!0,initializer:function(){return[]}}),v=r(s.prototype,"setState",[x.action],{enumerable:!0,initializer:function(){var e=this;return function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,I.default)(n).forEach(function(t){e[t]=n[t]})}}}),y=r(s.prototype,"doLogin",[x.action],{enumerable:!0,initializer:function(){var e=this;return function(){function n(e,n,t,o,i){var r=(0,A.default)({type:e?"1":"2",username:n,password:t,idcard:o,devid:i});z.default.callApi({url:"/api/integration/simplesso/getToken",method:"POST",params:{loginInfo:r}}).then(function(e){if(1==e.status){if(!e.ssoToken)return void S.default.info("\u767b\u5f55\u5931\u8d25");z.default.ls.set("customSessionKey",{keyName:"ssoToken",keyValue:e.ssoToken}),S.default.hide(),S.default.info("\u767b\u5f55\u6210\u529f",2,function(){window.location.href="/spa/em/mobile.html"})}else S.default.info("\u767b\u5f55\u5931\u8d25")}).catch(function(e){S.default.error((0,A.default)(e))})}var t=z.default.getFrameParams();if(window.e9ssoMobileConfig&&window.e9ssoMobileConfig.inUse&&window.e9ssoMobileConfig.customLogin)return void window.e9ssoMobileConfig.customLogin(t,(0,x.toJS)(e.accountLogin),(0,x.toJS)(e.account),(0,x.toJS)(e.password));var o=z.default.ls.getJSONObj("yulinAuthDatas");if("1"==t.isChange&&null!==o&&o)e.idNumber=o.staffIdno,e.deviceId=o.imei,window.longchengRedirectParams={uid:e.idNumber,staffCode:e.idNumber,devId:e.deviceId,devAddress:null,appCode:"10000243",reqServerId:"A2-BE339FCB9D83418592554A6B7F47A8BE",targetServerId:"A3-E616FF2887F54CE4B3B8ABA47598362D"},n((0,x.toJS)(e.accountLogin),(0,x.toJS)(e.account),(0,x.toJS)(e.password),(0,x.toJS)(e.idNumber),(0,x.toJS)(e.deviceId));else try{window.WebViewJavascriptBridge.callHandler("getThirdAuthInfo",{},function(e){var t={};t="string"===typeof e?JSON.parse(e).data:e.data,z.default.ls.set("yulinAuthDatas",t),window.longchengRedirectParams={uid:t.staffIdno,staffCode:t.staffIdno,devId:t.imei,devAddress:null,appCode:"10000243",reqServerId:"A2-BE339FCB9D83418592554A6B7F47A8BE",targetServerId:"A3-E616FF2887F54CE4B3B8ABA47598362D"},n(!1,"","",t.staffIdno,t.imei)}.bind(e))}catch(t){S.default.hide(),S.default.info("\u83b7\u53d6\u8bbe\u5907\u4fe1\u606f\u5931\u8d25\uff0c\u4f7f\u7528\u9ed8\u8ba4\u4fe1\u606f"),e.idNumber="450203198002220016",e.deviceId="867011036792968",window.longchengRedirectParams={uid:e.idNumber,staffCode:e.idNumber,devId:e.deviceId,devAddress:null,appCode:"10000243",reqServerId:"A2-BE339FCB9D83418592554A6B7F47A8BE",targetServerId:"A3-E616FF2887F54CE4B3B8ABA47598362D"},n(!1,"","",(0,x.toJS)(e.idNumber),(0,x.toJS)(e.deviceId))}}}}),s);n.default=_}},[724]);
//# sourceMappingURL=main.js.map?v=eb462269