Commit 2150b3ce by zhanghaozhe

Merge branch 'passport'

parents a8aeb17c 758b4a63
......@@ -57,9 +57,18 @@ const logout = () => dispatch => {
}
const UPDATE_USER = 'UPDATE_USER'
const updateUser = payload => ({
type: UPDATE_USER,
payload
})
export {
accountLogin,
SET_CURRENT_USER,
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 = {
......@@ -15,11 +16,12 @@ const initialState = {
}
export default function (state = initialState, action) {
switch (action.type) {
case SET_CURRENT_USER:
return action.payload
case UPDATE_USER:
return merge({}, state, action.payload)
default:
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