Skip to content

Commit adee2ad

Browse files
committed
update
1 parent 8c4900c commit adee2ad

File tree

22 files changed

+146
-124
lines changed

22 files changed

+146
-124
lines changed

Diff for: mock/mock-data.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ const ajaxTest = {
88
"data|1-10": [
99
{
1010
"id|+1": 1,
11-
email: "@EMAIL"
12-
}
13-
]
11+
email: "@EMAIL",
12+
},
13+
],
1414
};
1515

1616
exports.mockApi = (url, params) => {

Diff for: package.json

+25-25
Original file line numberDiff line numberDiff line change
@@ -24,60 +24,60 @@
2424
},
2525
"dependencies": {
2626
"@rematch/core": "^1.4.0",
27-
"antd": "4.0.0",
27+
"antd": "4.1.3",
2828
"axios": "^0.19.2",
29-
"core-js": "^3.6.4",
29+
"core-js": "^3.6.5",
3030
"history": "^4.10.1",
3131
"lodash": "^4.17.15",
32-
"react": "^16.13.0",
33-
"react-dom": "^16.13.0",
32+
"react": "^16.13.1",
33+
"react-dom": "^16.13.1",
3434
"react-loadable": "^5.5.0",
3535
"react-redux": "^7.2.0",
3636
"react-router-dom": "^5.1.2",
3737
"redux": "^4.0.5"
3838
},
3939
"devDependencies": {
40-
"@babel/core": "^7.8.6",
40+
"@babel/core": "^7.9.0",
4141
"@babel/plugin-proposal-class-properties": "^7.8.3",
4242
"@babel/plugin-proposal-decorators": "^7.8.3",
4343
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.8.3",
44-
"@babel/plugin-proposal-object-rest-spread": "^7.8.3",
45-
"@babel/plugin-proposal-optional-chaining": "^7.8.3",
44+
"@babel/plugin-proposal-object-rest-spread": "^7.9.5",
45+
"@babel/plugin-proposal-optional-chaining": "^7.9.0",
4646
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
47-
"@babel/plugin-transform-runtime": "^7.8.3",
48-
"@babel/preset-env": "^7.8.6",
49-
"@babel/preset-react": "^7.8.3",
50-
"@babel/runtime": "^7.8.4",
51-
"antd-dayjs-webpack-plugin": "^0.0.8",
52-
"autoprefixer": "^9.7.4",
47+
"@babel/plugin-transform-runtime": "^7.9.0",
48+
"@babel/preset-env": "^7.9.5",
49+
"@babel/preset-react": "^7.9.4",
50+
"@babel/runtime": "^7.9.2",
51+
"antd-dayjs-webpack-plugin": "^1.0.0",
52+
"autoprefixer": "^9.7.6",
5353
"babel-eslint": "^10.1.0",
54-
"babel-loader": "^8.0.6",
54+
"babel-loader": "^8.1.0",
5555
"babel-plugin-import": "^1.13.0",
5656
"body-parser": "^1.19.0",
5757
"clean-webpack-plugin": "^3.0.0",
58-
"css-loader": "^3.4.2",
58+
"css-loader": "^3.5.2",
5959
"eslint": "^6.8.0",
60-
"eslint-loader": "^3.0.3",
61-
"eslint-plugin-prettier": "^3.1.2",
62-
"eslint-plugin-react": "^7.18.3",
63-
"eslint-plugin-react-hooks": "^2.5.0",
60+
"eslint-loader": "^4.0.0",
61+
"eslint-plugin-prettier": "^3.1.3",
62+
"eslint-plugin-react": "^7.19.0",
63+
"eslint-plugin-react-hooks": "^3.0.0",
6464
"express": "^4.17.1",
6565
"favicons-webpack-plugin": "3.0.1",
66-
"file-loader": "^5.1.0",
66+
"file-loader": "^6.0.0",
6767
"happypack": "^5.0.1",
68-
"html-webpack-plugin": "^4.0.0-beta.11",
68+
"html-webpack-plugin": "^4.2.0",
6969
"less": "^3.11.1",
7070
"less-loader": "^5.0.0",
7171
"mini-css-extract-plugin": "^0.9.0",
7272
"mockjs": "^1.1.0",
7373
"optimize-css-assets-webpack-plugin": "^5.0.3",
7474
"postcss-loader": "^3.0.0",
75-
"prettier": "1.19.1",
76-
"style-loader": "1.1.3",
75+
"prettier": "2.0.4",
76+
"style-loader": "1.1.4",
7777
"sw-precache-webpack-plugin": "^1.0.0",
7878
"terser-webpack-plugin": "^2.3.5",
79-
"url-loader": "^3.0.0",
80-
"webpack": "^4.42.0",
79+
"url-loader": "^4.1.0",
80+
"webpack": "^4.42.1",
8181
"webpack-cli": "^3.3.11",
8282
"webpack-dev-middleware": "^3.7.2",
8383
"webpack-hot-middleware": "^2.25.0",

Diff for: src/component/footer/index.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@ import "./index.less";
55
export default function Footer(props) {
66
return (
77
<div className="footer">
8-
© 2018-2019{" "}
8+
© 2018-2020{" "}
99
<a
1010
href="https://blog.isluo.com"
1111
target="_blank"
12-
rel="noopener noreferrer"
13-
>
12+
rel="noopener noreferrer">
1413
isluo.com
1514
</a>
1615
, Inc.

Diff for: src/component/menu/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default function Menu() {
1212
to={{
1313
pathname: "/test",
1414
search: "?a=123&b=abc",
15-
state: { c: "456", d: "ABC" }
15+
state: { c: "456", d: "ABC" },
1616
}}
1717
>
1818
测试(hooks)
@@ -22,7 +22,7 @@ export default function Menu() {
2222
to={{
2323
pathname: "/testclass",
2424
search: "?a=123&b=abc",
25-
state: { c: "456", d: "ABC" }
25+
state: { c: "456", d: "ABC" },
2626
}}
2727
>
2828
测试(class)

Diff for: src/container/features/index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ function FeaturesPageContainer(props) {
5959
}
6060

6161
export default connect(
62-
state => ({}),
63-
dispatch => ({
64-
actions: {}
62+
(state) => ({}),
63+
(dispatch) => ({
64+
actions: {},
6565
})
6666
)(FeaturesPageContainer);

Diff for: src/container/home/index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ function HomePageContainer(props) {
2323
}
2424

2525
export default connect(
26-
state => {
26+
(state) => {
2727
return {};
2828
},
29-
dispatch => ({
30-
actions: {}
29+
(dispatch) => ({
30+
actions: {},
3131
})
3232
)(HomePageContainer);

Diff for: src/container/notfound/index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ function NotFoundPageContainer() {
1616
}
1717

1818
export default connect(
19-
state => ({}),
20-
dispatch => ({
21-
actions: {}
19+
(state) => ({}),
20+
(dispatch) => ({
21+
actions: {},
2222
})
2323
)(NotFoundPageContainer);

Diff for: src/container/routers/index.js

+12-12
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,23 @@ import "./index.less";
2424
const Home = Loadable({
2525
loader: () => import(/* webpackChunkName:'home' */ "../home"),
2626
loading: Loading, // 自定义的Loading动画组件
27-
timeout: 10000 // 可以设置一个超时时间(s)来应对网络慢的情况(在Loading动画组件中可以配置error信息)
27+
timeout: 10000, // 可以设置一个超时时间(s)来应对网络慢的情况(在Loading动画组件中可以配置error信息)
2828
});
2929
const Test = Loadable({
3030
loader: () => import(/* webpackChunkName:'test' */ "../test"),
31-
loading: Loading
31+
loading: Loading,
3232
});
3333
const TestClass = Loadable({
3434
loader: () => import(/* webpackChunkName:'testclass' */ "../testclass"),
35-
loading: Loading
35+
loading: Loading,
3636
});
3737
const Features = Loadable({
3838
loader: () => import(/* webpackChunkName:'features' */ "../features"),
39-
loading: Loading
39+
loading: Loading,
4040
});
4141
const NotFound = Loadable({
4242
loader: () => import(/* webpackChunkName:'notfound' */ "../notfound"),
43-
loading: Loading
43+
loading: Loading,
4444
});
4545

4646
const history = createHistory(); // 实例化history对象
@@ -79,19 +79,19 @@ function RootRouterContainer(props) {
7979
<Redirect exact from="/" to="/home" />
8080
<Route
8181
path="/home"
82-
render={props => onEnter(Home, props)}
82+
render={(props) => onEnter(Home, props)}
8383
/>
8484
<Route
8585
path="/features"
86-
render={props => onEnter(Features, props)}
86+
render={(props) => onEnter(Features, props)}
8787
/>
8888
<Route
8989
path="/test"
90-
render={props => onEnter(Test, props)}
90+
render={(props) => onEnter(Test, props)}
9191
/>
9292
<Route
9393
path="/testclass"
94-
render={props => onEnter(TestClass, props)}
94+
render={(props) => onEnter(TestClass, props)}
9595
/>
9696
<Route component={NotFound} />
9797
</Switch>
@@ -108,8 +108,8 @@ function RootRouterContainer(props) {
108108
}
109109

110110
export default connect(
111-
state => ({}),
112-
dispatch => ({
113-
actions: {}
111+
(state) => ({}),
112+
(dispatch) => ({
113+
actions: {},
114114
})
115115
)(RootRouterContainer);

Diff for: src/container/test/container/page1.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ function Page1(props) {
1010
}
1111

1212
export default connect(
13-
state => ({}),
14-
dispatch => ({
15-
actions: bindActionCreators({}, dispatch)
13+
(state) => ({}),
14+
(dispatch) => ({
15+
actions: bindActionCreators({}, dispatch),
1616
})
1717
)(Page1);

Diff for: src/container/test/container/page2.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ function Page2(props) {
1010
}
1111

1212
export default connect(
13-
state => ({}),
14-
dispatch => ({
15-
actions: bindActionCreators({}, dispatch)
13+
(state) => ({}),
14+
(dispatch) => ({
15+
actions: bindActionCreators({}, dispatch),
1616
})
1717
)(Page2);

Diff for: src/container/test/container/page3.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ function Page3(props) {
1010
}
1111

1212
export default connect(
13-
state => ({}),
14-
dispatch => ({
15-
actions: bindActionCreators({}, dispatch)
13+
(state) => ({}),
14+
(dispatch) => ({
15+
actions: bindActionCreators({}, dispatch),
1616
})
1717
)(Page3);

Diff for: src/container/test/index.js

+36-13
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function TestPageContainer({
4747
// 获取用户信息测试
4848
actions
4949
.getUserinfo({ id: 1 })
50-
.then(res => {
50+
.then((res) => {
5151
console.log("获取用户信息测试:", res);
5252
})
5353
.catch(() => {
@@ -65,7 +65,7 @@ function TestPageContainer({
6565

6666
// Fetch测试按钮点击时触发
6767
function onFetchClick() {
68-
actions.serverFetch().then(res => {
68+
actions.serverFetch().then((res) => {
6969
if (res.status === 200) {
7070
setMokeFetch(res.data);
7171
} else {
@@ -90,11 +90,17 @@ function TestPageContainer({
9090
<span className="backImage" />
9191
<span>上方图片,一张是img,一张是background</span>
9292
<br />
93-
<span>请特别注意,现在webpack.production.config.js中的publicPath配置为"/",</span>
93+
<span>
94+
请特别注意,现在webpack.production.config.js中的publicPath配置为"/",
95+
</span>
9496
<br />
95-
<span>如果你的项目最终打包后放到服务器上的访问路径为https://xxx.com,这没有问题</span>
97+
<span>
98+
如果你的项目最终打包后放到服务器上的访问路径为https://xxx.com,这没有问题
99+
</span>
96100
<br />
97-
<span>如果你的项目访问路径为https://xxx.com/aaa,请把webpack.production.config.js中的publicPath配置为"/aaa/"</span>
101+
<span>
102+
如果你的项目访问路径为https://xxx.com/aaa,请把webpack.production.config.js中的publicPath配置为"/aaa/"
103+
</span>
98104
</p>
99105
</div>
100106
<div className="list">
@@ -128,11 +134,23 @@ function TestPageContainer({
128134
<h2>Antd表单</h2>
129135
<div style={{ maxWidth: "400px" }}>
130136
<Form {...layout} onFinish={handleSubmit}>
131-
<Form.Item label="用户名" name="username" rules={[{ required: true, message: "请输入用户名" }]}>
137+
<Form.Item
138+
label="用户名"
139+
name="username"
140+
rules={[{ required: true, message: "请输入用户名" }]}
141+
>
132142
<Input prefix={<UserOutlined />} placeholder="用户名" />
133143
</Form.Item>
134-
<Form.Item label="密码" name="password" rules={[{ required: true, message: "请输入密码" }]}>
135-
<Input type="password" prefix={<KeyOutlined />} placeholder="密码" />
144+
<Form.Item
145+
label="密码"
146+
name="password"
147+
rules={[{ required: true, message: "请输入密码" }]}
148+
>
149+
<Input
150+
type="password"
151+
prefix={<KeyOutlined />}
152+
placeholder="密码"
153+
/>
136154
</Form.Item>
137155
<Form.Item>
138156
<Button type="primary" htmlType="submit">
@@ -154,7 +172,7 @@ function TestPageContainer({
154172
state参数:
155173
{location.state
156174
? Object.entries(location.state)
157-
.map(v => `${v[0]}=${v[1]}`)
175+
.map((v) => `${v[0]}=${v[1]}`)
158176
.join(",")
159177
: ""}
160178
</p>
@@ -201,23 +219,28 @@ function TestPageContainer({
201219
</div>
202220
</div>
203221
</div>
204-
<Modal title="模态框" visible={visible} onOk={() => setVisible(false)} onCancel={() => setVisible(false)}>
222+
<Modal
223+
title="模态框"
224+
visible={visible}
225+
onOk={() => setVisible(false)}
226+
onCancel={() => setVisible(false)}
227+
>
205228
<p>内容...</p>
206229
</Modal>
207230
</div>
208231
);
209232
}
210233

211234
export default connect(
212-
state => ({
235+
(state) => ({
213236
userinfo: state.app.userinfo, // 引入app model中的userinfo数据
214237
count: state.test.count, // 引入test model中的count数据
215238
}),
216-
dispatch => ({
239+
(dispatch) => ({
217240
actions: {
218241
getUserinfo: dispatch.app.getUserinfo, // 引入app model中的获取用户信息action
219242
onTestAdd: dispatch.test.onTestAdd, // 引入test model中的数字+1 action
220243
serverFetch: dispatch.test.serverFetch, // 引入test model中的fetch异步请求action
221244
},
222-
}),
245+
})
223246
)(TestPageContainer);

Diff for: src/container/testclass/container/page1.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import P from "prop-types";
99
class Page1 extends React.Component {
1010
static propTypes = {
1111
location: P.any,
12-
history: P.any
12+
history: P.any,
1313
};
1414

1515
constructor(props) {
@@ -23,8 +23,8 @@ class Page1 extends React.Component {
2323
}
2424

2525
export default connect(
26-
state => ({}),
27-
dispatch => ({
28-
actions: bindActionCreators({}, dispatch)
26+
(state) => ({}),
27+
(dispatch) => ({
28+
actions: bindActionCreators({}, dispatch),
2929
})
3030
)(Page1);

0 commit comments

Comments
 (0)