Skip to content
This repository was archived by the owner on Aug 24, 2019. It is now read-only.

Commit 94fbc74

Browse files
committed
update framework
1 parent 0a2bc39 commit 94fbc74

File tree

12 files changed

+49
-108
lines changed

12 files changed

+49
-108
lines changed

src/containers/AccessKeysContainer.js

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ import * as usersActions from '../actions/usersActions';
77
import * as authActions from '../actions/authActions';
88
import * as routesActions from '../actions/routesActions';
99
import AccessKeys from '../components/AccessKeys';
10-
import HeaderContainer from './HeaderContainer';
11-
import Footer from '../components/Footer';
1210

1311
class AccessKeysContainer extends Component {
1412
componentDidMount() {
@@ -24,21 +22,17 @@ class AccessKeysContainer extends Component {
2422
render() {
2523
const {accessKeys, actions } = this.props;
2624
return (
27-
<div>
28-
<HeaderContainer/>
29-
<AccessKeys
30-
isFetching={_.get(accessKeys, 'isFetching')}
31-
rs={_.get(accessKeys, 'rs')}
32-
removeKey={actions.reomveAccessKey}
33-
patchKey={actions.patchAccessKey}
34-
isCreating={_.get(accessKeys, 'isCreating')}
35-
createKey={actions.createAccessKey}
36-
isShowKey={_.get(accessKeys, 'showKey.isOpen')}
37-
close={actions.closePopShowKey}
38-
token={_.get(accessKeys, 'showKey.token')}
39-
/>
40-
<Footer/>
41-
</div>
25+
<AccessKeys
26+
isFetching={_.get(accessKeys, 'isFetching')}
27+
rs={_.get(accessKeys, 'rs')}
28+
removeKey={actions.reomveAccessKey}
29+
patchKey={actions.patchAccessKey}
30+
isCreating={_.get(accessKeys, 'isCreating')}
31+
createKey={actions.createAccessKey}
32+
isShowKey={_.get(accessKeys, 'showKey.isOpen')}
33+
close={actions.closePopShowKey}
34+
token={_.get(accessKeys, 'showKey.token')}
35+
/>
4236
);
4337
}
4438
}

src/containers/ChangePasswordContainer.js

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ import * as usersActions from '../actions/usersActions';
77
import * as authActions from '../actions/authActions';
88
import * as routesActions from '../actions/routesActions';
99
import ChangePassword from '../components/ChangePassword';
10-
import HeaderContainer from './HeaderContainer';
11-
import Footer from '../components/Footer';
1210

1311
class ChangePasswordContainer extends Component {
1412
componentDidMount() {
@@ -27,21 +25,17 @@ class ChangePasswordContainer extends Component {
2725
let oldPassword = _.get(password, 'oldPassword');
2826
let newPassword = _.get(password, 'newPassword');
2927
return (
30-
<div>
31-
<HeaderContainer/>
32-
<ChangePassword
33-
isFetching={_.get(password, 'isFetching')}
34-
oldPassword={oldPassword}
35-
oldPasswordInputChange={actions.passwordChangeOldInput}
36-
newPassword={newPassword}
37-
newPasswordInputChange={actions.passwordChangeNewInput}
38-
newPasswordConfirm={_.get(password, 'newPasswordConfirm')}
39-
newPasswordConfirmInputChange={actions.passwordChangeNewConfirmInput}
40-
submit={()=>actions.modifyPassword(oldPassword, newPassword)}
41-
error={_.get(password, 'error')}
42-
/>
43-
<Footer/>
44-
</div>
28+
<ChangePassword
29+
isFetching={_.get(password, 'isFetching')}
30+
oldPassword={oldPassword}
31+
oldPasswordInputChange={actions.passwordChangeOldInput}
32+
newPassword={newPassword}
33+
newPasswordInputChange={actions.passwordChangeNewInput}
34+
newPasswordConfirm={_.get(password, 'newPasswordConfirm')}
35+
newPasswordConfirmInputChange={actions.passwordChangeNewConfirmInput}
36+
submit={()=>actions.modifyPassword(oldPassword, newPassword)}
37+
error={_.get(password, 'error')}
38+
/>
4539
);
4640
}
4741
}

src/containers/HeaderContainer.js

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/containers/HomeContainer.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,11 @@ import _ from 'lodash';
66
import * as usersActions from '../actions/usersActions';
77
import * as routesActions from '../actions/routesActions';
88
import Home from '../components/Home';
9-
import HeaderContainer from './HeaderContainer';
10-
import Footer from '../components/Footer';
119

1210
class HomeContainer extends Component {
1311
render() {
1412
const {html, actions } = this.props;
15-
return (
16-
<div>
17-
<HeaderContainer/>
18-
<Home html={html}/>
19-
<Footer/>
20-
</div>
21-
);
13+
return <Home html={html}/>;
2214
}
2315
}
2416

src/containers/ProductListContainer.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ import * as usersActions from '../actions/usersActions';
77
import * as authActions from '../actions/authActions';
88
import * as routesActions from '../actions/routesActions';
99
import ProductList from '../components/ProductList';
10-
import HeaderContainer from './HeaderContainer';
11-
import Footer from '../components/Footer';
1210

1311
class ProductListContainer extends Component {
1412
componentDidMount() {
@@ -24,14 +22,10 @@ class ProductListContainer extends Component {
2422
render() {
2523
const {products, actions } = this.props;
2624
return (
27-
<div>
28-
<HeaderContainer/>
29-
<ProductList
30-
isFetching={_.get(products, 'isFetching')}
31-
rs={_.get(products, 'rs')}
32-
/>
33-
<Footer/>
34-
</div>
25+
<ProductList
26+
isFetching={_.get(products, 'isFetching')}
27+
rs={_.get(products, 'rs')}
28+
/>
3529
);
3630
}
3731
}

src/routes/accessKeys/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React from 'react';
2-
import Layout from '../../components/Layout';
3-
import AccessKeysContainer from '../../containers/AccessKeysContainer';
2+
import LayoutContainer from '../../containers/LayoutContainer';
43
import { fetchAccessKeys } from '../../actions/authActions';
54

65
export default {
@@ -13,9 +12,11 @@ export default {
1312
store.dispatch(fetchAccessKeys());
1413
}, 100);
1514
}
15+
const AccessKeysContainer = await require.ensure([], require => require('../../containers/AccessKeysContainer').default, 'accessKeys');
1616
return {
1717
title: '我的密钥',
18-
component: <Layout><AccessKeysContainer /></Layout>,
18+
chunk: 'accessKeys',
19+
component: <LayoutContainer><AccessKeysContainer /></LayoutContainer>,
1920
};
2021
},
2122

src/routes/apps/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
import React from 'react';
3-
import Layout from '../../components/Layout';
3+
import LayoutContainer from '../../containers/LayoutContainer';
44
import { getProducts } from '../../actions/productsActions';
55

66
export default {
@@ -17,7 +17,7 @@ export default {
1717
return {
1818
title: '应用管理',
1919
chunk: 'apps',
20-
component: <Layout><ProductListContainer /></Layout>,
20+
component: <LayoutContainer><ProductListContainer /></LayoutContainer>,
2121
};
2222
},
2323

src/routes/home/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99

1010
import React from 'react';
1111
import fetch from '../../core/fetch';
12-
import Layout from '../../components/Layout';
12+
import LayoutContainer from '../../containers/LayoutContainer';
1313
import restApi from '../../network/RestApi';
14-
import HomeContainer from '../../containers/HomeContainer';
1514

1615
export default {
1716

@@ -28,9 +27,11 @@ export default {
2827
});
2928
if (resp.status !== 200) throw new Error(resp.statusText);
3029
const data = await resp.text();
30+
const HomeContainer = await require.ensure([], require => require('../../containers/HomeContainer').default, 'home');
3131
return {
3232
title: 'CodePushServer',
33-
component: <Layout><HomeContainer html={data} /></Layout>,
33+
chunk: 'home',
34+
component: <LayoutContainer><HomeContainer html={data} /></LayoutContainer>,
3435
};
3536
},
3637

src/routes/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export default {
3333
const route = await next();
3434

3535
// Provide default values for title, description etc.
36-
route.title = `${route.title || 'Untitled Page'} - www.reactstarterkit.com`;
36+
route.title = `${route.title || 'Untitled Page'}`;
3737
route.description = route.description || '';
3838

3939
return route;

src/routes/login/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
import React from 'react';
22
import Layout from '../../components/Layout';
3-
import LoginContainer from '../../containers/LoginContainer';
43
import LogoutContainer from '../../containers/LogoutContainer';
54

65
const login = {
76

87
path: '/login',
98

10-
action() {
9+
async action() {
10+
const LoginContainer = await require.ensure([], require => require('../../containers/LoginContainer').default, 'login');
1111
return {
1212
title: '登录',
13+
chunk: 'login',
1314
component: <Layout><LoginContainer /></Layout>,
1415
};
1516
},
@@ -19,7 +20,7 @@ const logout = {
1920

2021
path: '/logout',
2122

22-
action() {
23+
async action() {
2324
return {
2425
title: '退出',
2526
component: <Layout><LogoutContainer /></Layout>,

0 commit comments

Comments
 (0)