[ISSUE #2835] Fix an uncaught exception when accessing restricted namespace in authentication mode. (#3541)

* Fix an uncaught exception when accessing restricted namespace in authentication mode.

* Resolved merge conflict

* Withdraw changes that are not part of this pr
This commit is contained in:
ljhrot 2020-08-10 09:07:17 +08:00 committed by GitHub
parent ac8ced1cb5
commit c45542c8ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 14 deletions

View File

@ -250,6 +250,7 @@ class ConfigurationManagement extends React.Component {
if (this.state.loading) {
return;
}
const { locale = {}, configurations = {} } = this.props;
this.tenant = getParams('namespace') || ''; // 为当前实例保存tenant参数
this.serverId = getParams('serverId') || '';
const prePageNo = getParams('pageNo');
@ -273,14 +274,29 @@ class ConfigurationManagement extends React.Component {
params.search = 'accurate';
}
this.setState({ loading: true });
this.props.getConfigs(params).then(() =>
this.setState({
loading: false,
selectedRecord: [],
selectedKeys: [],
tenant: this.tenant,
})
);
this.props
.getConfigs(params)
.then(() =>
this.setState({
loading: false,
selectedRecord: [],
selectedKeys: [],
tenant: this.tenant,
})
)
.catch(res => {
configurations.pageItems = [];
configurations.totalCount = 0;
this.setState({
loading: false,
});
if (res && [401, 403].includes(res.status)) {
Dialog.alert({
title: locale.importFail,
content: locale.importFail403,
});
}
});
}
showMore() {}

File diff suppressed because one or more lines are too long