feat: 登录后跳转到首页

This commit is contained in:
wenbo.dong 2017-07-25 11:22:42 +08:00
parent d349a43184
commit 7d100b5b68
3 changed files with 28 additions and 8 deletions

View File

@ -2,6 +2,6 @@ export default {
PAGE_LIMIT: 10, // 默认每页展示10条数据
// layout
ROW_MIN_WIDTH: '9.7rem',
ROW_MAX_WIDTH: '11.7rem'
ROW_MIN_WIDTH: '9.7rem', // 适应小屏幕分辨率
ROW_MAX_WIDTH: '11.7rem' // 适应大屏幕分辨率
}

View File

@ -2,7 +2,8 @@ import {
LOGIN,
LOGIN_OUT,
LOGIN_TYPE,
GET_LOGIN_STATE
GET_LOGIN_STATE,
REGISTER
} from '../../constants/action-types';
const LOADING_STATUS = 0;
@ -13,8 +14,8 @@ const initialState = {
isLogin: false,
userName: null,
uid: null,
loginState:LOADING_STATUS,
loginWrapActiveKey:"1"
loginState: LOADING_STATUS,
loginWrapActiveKey: "1"
};
export default (state = initialState, action) => {
@ -51,6 +52,15 @@ export default (state = initialState, action) => {
loginWrapActiveKey: action.index
};
}
case REGISTER: {
return {
...state,
isLogin: true,
loginState: MEMBER_STATUS,
uid: action.payload.data.data.uid,
userName: action.payload.data.data.username
};
}
default:
return state;
}

View File

@ -2,7 +2,8 @@ import {
LOGIN,
LOGIN_OUT,
LOGIN_TYPE,
GET_LOGIN_STATE
GET_LOGIN_STATE,
REGISTER
} from '../../constants/action-types';
const LOADING_STATUS = 0;
@ -13,8 +14,8 @@ const initialState = {
isLogin: false,
userName: null,
uid: null,
loginState:LOADING_STATUS,
loginWrapActiveKey:"1"
loginState: LOADING_STATUS,
loginWrapActiveKey: "1"
};
export default (state = initialState, action) => {
@ -51,6 +52,15 @@ export default (state = initialState, action) => {
loginWrapActiveKey: action.index
};
}
case REGISTER: {
return {
...state,
isLogin: true,
loginState: MEMBER_STATUS,
uid: action.payload.data.data.uid,
userName: action.payload.data.data.username
};
}
default:
return state;
}