mirror of
https://github.com/YMFE/yapi.git
synced 2025-01-06 12:45:22 +08:00
feat: 登录后跳转到首页
This commit is contained in:
parent
d349a43184
commit
7d100b5b68
@ -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' // 适应大屏幕分辨率
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user