Skip to content

Commit

Permalink
[ISSUE alibaba#8880] add a request exception handler (alibaba#8881)
Browse files Browse the repository at this point in the history
* [ISSUE alibaba#8880] add a request exception handler

Close alibaba#8880

* [ISSUE alibaba#8880] retry ci
  • Loading branch information
onewe authored Aug 5, 2022
1 parent 0b428e0 commit 54a3b9e
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 21 deletions.
1 change: 1 addition & 0 deletions console-ui/src/locales/en-US.js
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,7 @@ const I18N_CONF = {
dialogTitle: 'Content Comparison',
dialogCurrentArea: 'Current Value',
dialogOriginalArea: 'Original Value',
publishFailed403: 'Publish failed. No operation permission',
},
EditorNameSpace: {
notice: 'Notice',
Expand Down
1 change: 1 addition & 0 deletions console-ui/src/locales/zh-CN.js
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@ const I18N_CONF = {
dialogTitle: '内容比较',
dialogCurrentArea: '当前值',
dialogOriginalArea: '原始值',
publishFailed403: '发布失败,请检查是否有权限',
},
EditorNameSpace: {
notice: '提示',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,16 +262,26 @@ class ConfigEditor extends React.Component {
method: 'post',
data: stringify(payload),
headers,
}).then(res => {
if (res) {
if (isNewConfig) {
this.setState({ isNewConfig: false });
}).then(
res => {
if (res) {
if (isNewConfig) {
this.setState({ isNewConfig: false });
}
this.getConfig(beta);
}
this.setState({ loading: false });
return res;
},
error => {
this.setState({ loading: false });
if (error.status && error.status === 403) {
Dialog.alert({
content: this.props.locale.publishFailed403,
});
}
this.getConfig(beta);
}
this.setState({ loading: false });
return res;
});
);
}

publishBeta() {
Expand Down
4 changes: 2 additions & 2 deletions console/src/main/resources/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<link rel="stylesheet" type="text/css" href="console-ui/public/css/icon.css">
<link rel="stylesheet" type="text/css" href="console-ui/public/css/font-awesome.css">
<!-- 第三方css结束 -->
<link href="./css/main.css?7cef8a6da66307e01c69" rel="stylesheet"></head>
<link href="./css/main.css?04818f5ec59842280923" rel="stylesheet"></head>

<body>
<div id="root" style="overflow:hidden"></div>
Expand All @@ -56,6 +56,6 @@
<script src="console-ui/public/js/merge.js"></script>
<script src="console-ui/public/js/loader.js"></script>
<!-- 第三方js结束 -->
<script type="text/javascript" src="./js/main.js?7cef8a6da66307e01c69"></script></body>
<script type="text/javascript" src="./js/main.js?04818f5ec59842280923"></script></body>

</html>
Loading

0 comments on commit 54a3b9e

Please sign in to comment.