fix: state compatible

This commit is contained in:
LoadChange 2019-02-28 21:10:37 +08:00
parent f88b8018b5
commit 6a6fe71c37
2 changed files with 25 additions and 14 deletions

View File

@ -21,7 +21,9 @@ const initialState = {
};
const getState = () => dispatch =>
request.get('v1/console/server/state').then(res => {
request
.get('v1/console/server/state')
.then(res => {
dispatch({
type: GET_STATE,
data: {
@ -30,6 +32,15 @@ const getState = () => dispatch =>
functionMode: res.function_mode,
},
});
})
.catch(() => {
dispatch({
type: GET_STATE,
data: {
version: null,
functionMode: null,
},
});
});
export default (state = initialState, action) => {

File diff suppressed because one or more lines are too long