diff --git a/src/containers/List/index.jsx b/src/containers/List/index.jsx index 6fb505b4..b90a534d 100644 --- a/src/containers/List/index.jsx +++ b/src/containers/List/index.jsx @@ -515,7 +515,7 @@ export default class BaseList extends React.Component { } catch (e) { // eslint-disable-next-line no-console console.log('fetch list error', e); - const { message = '', data, status } = e.response || e || {}; + const { message = '', data, status } = (e || {}).response || e || {}; if (status === 500) { const sysErr = t('System is error, please try again later.'); const title = `${t('Get {name} error.', { diff --git a/src/containers/TabDetail/index.jsx b/src/containers/TabDetail/index.jsx index 60e942eb..34e593a4 100644 --- a/src/containers/TabDetail/index.jsx +++ b/src/containers/TabDetail/index.jsx @@ -245,7 +245,7 @@ export default class DetailBase extends React.Component { catch = (e) => { // eslint-disable-next-line no-console console.log(e); - const { data, status } = e.response || e || {}; + const { data, status } = (e || {}).response || e || {}; if (status === 404) { this.setState({ notFound: true }); Notify.warn( diff --git a/src/libs/axios.js b/src/libs/axios.js index 0eaf4e90..2625c5fc 100644 --- a/src/libs/axios.js +++ b/src/libs/axios.js @@ -14,7 +14,7 @@ import Axios from 'axios'; import { getLocalStorageItem } from 'utils/local-storage'; -import { getOpenstackApiVersion } from 'utils/constants'; +import { getOpenstackApiVersion } from 'client/client/constants'; import Notify from 'components/Notify'; import { isEqual } from 'lodash'; import baseURL from './base-url';