Commit 92130053 authored by tangwei's avatar tangwei

解决打包内存溢出

parent 4c999556
......@@ -5,8 +5,8 @@
"author": "ilex.h",
"scripts": {
"clean": "rimraf dist released",
"build": "set NODE_ENV=production && npm run clean && webpack",
"build:dev": "set NODE_ENV=development && npm run clean && webpack",
"build": "set NODE_ENV=production && npm run clean && webpack",
"build:dev": "set NODE_ENV=development && npm run clean && webpack",
"watch": "webpack -w",
"server": "nodemon server/index.js --watch server",
"start": "set NODE_ENV=development && webpack-dev-server",
......@@ -37,7 +37,7 @@
"amos-pluggable": "^1.0.6",
"amos-processor": "^1.2.17",
"amos-rules-config": "^1.0.4",
"amos-security": "^2.0.19",
"amos-tool": "^1.x",
"amos-viz": "^1.x",
"amos-websocket": "^1.0.3",
......
import React, { Component } from 'react';
import { browserHistory } from 'amos-react-router';
import Login from 'amos-security/lib/view/login/LoginWithSignup';
import { Store, DES } from 'amos-tool';
import Footer from './Footer';
import { securityKey } from '../../consts/urlConsts';
import { cacheConsts } from './../../utils/cacheUtils';
import * as endConf from 'amos-processor/lib/config/endconf';
const AmosConfig = endConf.AmosConfig;
const accessToken = AmosConfig.autoLoginConf.accessToken;
const lsTool = Store.lsTool;
class LoginComponent extends Component {
constructor(props) {
super(props);
}
onBeforeLogin = (e) => {
e["accessToken"] = accessToken;
let pd = e.password;
const enPwd = DES.encode(pd, securityKey);
lsTool.write('xjInfo', enPwd);
};
goto = (authData,permissions) => {
lsTool.remove(cacheConsts.CURRENT_REGION);
const { roleTypeName } = authData.user.role;
if(roleTypeName === 'PERSONAL'){
browserHistory.push('/console');
}else{
browserHistory.push('/region');
}
};
render() {
const desict = (
<div className="amos-slogan" >
<span></span>
</div>
);
return (
<Login
// logo="/src/assets/auth/amos-logo.png//src/assets/auth/amos-logo.png"
logo={<div className='safety-logo'><img src='' alt='' /></div>}
title="IFC100消防指挥系统"
goto={this.goto}
desicOne={null}
desictTow={desict}
footer={<Footer />}
showVerifyCode={false}
onBeforeLogin={this.onBeforeLogin}
/>
);
}
}
LoginComponent.propTypes = {};
export default LoginComponent;
// import React, { Component } from 'react';
// import { browserHistory } from 'amos-react-router';
// import Login from 'amos-security/lib/view/login/LoginWithSignup';
// import { Store, DES } from 'amos-tool';
// import Footer from './Footer';
// import { securityKey } from '../../consts/urlConsts';
// import { cacheConsts } from './../../utils/cacheUtils';
// import * as endConf from 'amos-processor/lib/config/endconf';
// const AmosConfig = endConf.AmosConfig;
// const accessToken = AmosConfig.autoLoginConf.accessToken;
// const lsTool = Store.lsTool;
// class LoginComponent extends Component {
// constructor(props) {
// super(props);
// }
// onBeforeLogin = (e) => {
// e["accessToken"] = accessToken;
// let pd = e.password;
// const enPwd = DES.encode(pd, securityKey);
// lsTool.write('xjInfo', enPwd);
// };
// goto = (authData,permissions) => {
// lsTool.remove(cacheConsts.CURRENT_REGION);
// const { roleTypeName } = authData.user.role;
// if(roleTypeName === 'PERSONAL'){
// browserHistory.push('/console');
// }else{
// browserHistory.push('/region');
// }
// };
// render() {
// const desict = (
// <div className="amos-slogan" >
// <span></span>
// </div>
// );
// return (
// <Login
// // logo="/src/assets/auth/amos-logo.png//src/assets/auth/amos-logo.png"
// logo={<div className='safety-logo'><img src='' alt='' /></div>}
// title="IFC100消防指挥系统"
// goto={this.goto}
// desicOne={null}
// desictTow={desict}
// footer={<Footer />}
// showVerifyCode={false}
// onBeforeLogin={this.onBeforeLogin}
// />
// );
// }
// }
// LoginComponent.propTypes = {};
// export default LoginComponent;
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment