解决冲突

This commit is contained in:
waliang.wang 2017-08-01 15:12:07 +08:00
parent 15b8e5aa42
commit 50c6ef7b93

View File

@ -21,9 +21,11 @@ const initialState = {
export default (state = initialState, action) => {
switch (action.type) {
case GET_LOGIN_STATE: {
console.log(action.payload.data);
return {
...state,
isLogin: (action.payload.data.errcode == 0),
role: action.payload.data.data ? action.payload.data.data.role:null,
loginState: (action.payload.data.errcode == 0)?MEMBER_STATUS:GUEST_STATUS,
userName: action.payload.data.data ? action.payload.data.data.username : null,
uid: action.payload.data.data ? action.payload.data.data._id : null,