forked from aemoe/fairy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed hot-loader bug and replace react-router 4.0
- Loading branch information
Showing
24 changed files
with
169 additions
and
322 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"presets": ["react", ["es2015", {"modules": false}], "stage-0", "stage-1", "stage-2", "stage-3"], | ||
"presets": ["react", "es2015", "stage-0", "stage-1", "stage-2", "stage-3"], | ||
"plugins": ["react-hot-loader/babel","transform-runtime"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,29 @@ | ||
import Mock from 'mockjs'; | ||
|
||
Mock.mock('http://localhost:5000/login', { | ||
Mock.mock('/login', { | ||
'success': true, | ||
'status': 200, | ||
'message': '登录成功', | ||
'message': '登录失败!', | ||
'data': {} | ||
}); | ||
|
||
Mock.mock('/vaildate_user', { | ||
'success': true, | ||
'status': 200, | ||
'message': '用户名有重复!', | ||
'data': {} | ||
}); | ||
|
||
Mock.mock('/vaildate_email', { | ||
'success': true, | ||
'status': 200, | ||
'message': '邮箱已被占用!', | ||
'data': {} | ||
}); | ||
|
||
Mock.mock('/reg_user', { | ||
'success': true, | ||
'status': 200, | ||
'message': '注册失败!', | ||
'data': {} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
import * as types from '../constants/ActionTypes' | ||
|
||
export const increment = () => ({ type: types.INCREMENT }) | ||
//user | ||
export const login = () => ({ type: types.LOGIN }) | ||
export const logout = () => ({ type: types.LOGOUT }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
export const INCREMENT = 'INCREMENT' | ||
export const LOGIN = 'LOGIN' //user logined | ||
export const LOGOUT = 'LOGOUT' //user logout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import configureStore from './configureStore' | ||
|
||
const store = configureStore() | ||
const store = configureStore(window.__REDUX_DATA__) | ||
|
||
export default store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
import { applyMiddleware } from 'redux'; | ||
import {applyMiddleware} from 'redux'; | ||
import thunk from 'redux-thunk'; | ||
import logger from 'redux-logger'; | ||
|
||
export default applyMiddleware( | ||
thunk , logger | ||
) | ||
let middleWare; | ||
if (process.env.NODE_ENV === 'production') { | ||
middleWare = applyMiddleware(thunk); | ||
} else { | ||
middleWare = applyMiddleware(thunk, logger); | ||
} | ||
export default middleWare; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.