Skip to content

Commit 8c87155

Browse files
author
苗园园
committed
fix(fix fetch): fix fetch
fix fetch fix fetch
1 parent 9a8e32a commit 8c87155

File tree

16 files changed

+31
-324
lines changed

16 files changed

+31
-324
lines changed

scripts/build.js

-150
This file was deleted.

scripts/start.js

-107
This file was deleted.

scripts/test.js

-27
This file was deleted.

src/components/index.js

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
export { BaseTitle } from './BaseTitle/BaseTitle';
22

33
export { Nav } from './Nav/Nav';
4-
5-
export { Login } from './#/#';

src/constants/actionTypes.js

+2
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@
33
export const LOGIN_PENDING = 'LOGIN_PENDING';
44
export const LOGIN_FULFILLED = 'LOGIN_FULFILLED';
55
export const LOGIN_REJECTED = 'LOGIN_REJECTED';
6+
7+
export const SAVE_USER_DATA = 'LOGIN_REJECTED'; // 保存用户信息到redux
68
/**********************************登陆*************************************/

src/containers/App/App.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import React, { Component } from 'react';
22
import { BrowserRouter as Router, Route, Link } from 'react-router-dom';
33
import { Layout } from 'antd';
4-
import {BaseTitle, Nav, Login } from '../../components';
4+
import {BaseTitle, Nav } from '../../components';
5+
import { Login } from '../../containers'
56
import Routes from '../../routes';
67
import './App.css';
78
const { Header, Content } = Layout;
File renamed without changes.

src/components/#/#.js src/containers/#/#.js

+4
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,15 @@ export class Login extends React.Component {
2525
}
2626

2727
handleSubmit (e) {
28+
const _this = this;
2829
e.preventDefault();
2930
this.props.form.validateFields((err, values) => {
3031
if (!err) {
3132
console.log('Received values of form: ', values);
3233
this.props.login(values).then((res)=>{
34+
_this.props.saveUserData(res.value);
35+
// debugger
36+
// _this.props.loginData.userData
3337
this.props.history.push('/home');
3438
})
3539
}
File renamed without changes.
File renamed without changes.

src/containers/index.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
export { App } from './App/App';
2-
export { Home } from './Home/Home'; //首页
1+
export { Login } from './#/#';
32

3+
export { App } from './App/App';
44

5+
export { Home } from './Home/Home';

src/index.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ import {ConnectedRouter} from 'react-router-redux'
66
import store, { history } from './store/configureStore'
77
import registerServiceWorker from './registerServiceWorker'
88
import './style/main.css'
9-
import { App } from './containers'
10-
import { Login } from './components'
9+
import { App, Login } from './containers'
1110

1211
const target = document.querySelector('#root');
1312

src/reducers/counter.js

-28
This file was deleted.

src/reducers/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { combineReducers } from 'redux'
22
import { routerReducer } from 'react-router-redux'
3-
import counter from './counter'
3+
import loginData from './login'
44

55
export default combineReducers({
66
router: routerReducer,
7-
counter
7+
loginData,
88
})

0 commit comments

Comments
 (0)