Merge pull request #848 from alibaba/function_mode

fix: state compatible
This commit is contained in:
xxc 2019-03-01 00:35:54 +08:00 committed by GitHub
commit 07973d34ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 14 deletions

View File

@ -21,16 +21,27 @@ const initialState = {
};
const getState = () => dispatch =>
request.get('v1/console/server/state').then(res => {
dispatch({
type: GET_STATE,
data: {
version: res.version,
standaloneMode: res.standalone_mode,
functionMode: res.function_mode,
},
request
.get('v1/console/server/state')
.then(res => {
dispatch({
type: GET_STATE,
data: {
version: res.version,
standaloneMode: res.standalone_mode,
functionMode: res.function_mode,
},
});
})
.catch(() => {
dispatch({
type: GET_STATE,
data: {
version: null,
functionMode: null,
},
});
});
});
export default (state = initialState, action) => {
switch (action.type) {

File diff suppressed because one or more lines are too long