[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:
parent
ac8ced1cb5
commit
c45542c8ff
@ -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
Loading…
Reference in New Issue
Block a user