Commit 2150b3ce by zhanghaozhe

Merge branch 'passport'

parents a8aeb17c 758b4a63
...@@ -57,9 +57,18 @@ const logout = () => dispatch => { ...@@ -57,9 +57,18 @@ const logout = () => dispatch => {
} }
const UPDATE_USER = 'UPDATE_USER'
const updateUser = payload => ({
type: UPDATE_USER,
payload
})
export { export {
accountLogin, accountLogin,
SET_CURRENT_USER, SET_CURRENT_USER,
setCurrentUser, setCurrentUser,
quickLogin quickLogin,
logout,
UPDATE_USER,
updateUser
} }
\ No newline at end of file
import { SET_CURRENT_USER } from '@/store/userAction'; import { SET_CURRENT_USER, UPDATE_USER } from '@/store/userAction';
import { merge } from 'lodash'
const initialState = { const initialState = {
...@@ -15,11 +16,12 @@ const initialState = { ...@@ -15,11 +16,12 @@ const initialState = {
} }
export default function (state = initialState, action) { export default function (state = initialState, action) {
switch (action.type) { switch (action.type) {
case SET_CURRENT_USER: case SET_CURRENT_USER:
return action.payload return action.payload
case UPDATE_USER:
return merge({}, state, action.payload)
default: default:
return state return state
} }
......
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