Skip to content

Commit

Permalink
修改对比偶尔不显示问题
Browse files Browse the repository at this point in the history
  • Loading branch information
zkboys committed Sep 29, 2018
1 parent 0f6b2eb commit 25bb9a7
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,20 @@ class Diff extends Component {
currentConfigText: rsp.data.propertySource,
currentVersionId: rsp.data.version,
});
}
});
promiseAjax.get(`/applicationconfiglog/${historyId}`).then(rsp => {
if (rsp.status) {
this.setState({
historyConfigText: rsp.data.propertySource,
historyVersionId: rsp.data.version
}, () => {
const iframe = document.createElement('iframe');
iframe.src = '/static/diffhtml.html';
iframe.width = '100%';
iframe.setAttribute("frameborder", 0);
iframe.setAttribute("id", 'diffIframe');
document.getElementById('prettydiff').appendChild(iframe);
promiseAjax.get(`/applicationconfiglog/${historyId}`).then(rsp => {
if (rsp.status) {
this.setState({
historyConfigText: rsp.data.propertySource,
historyVersionId: rsp.data.version
}, () => {
const iframe = document.createElement('iframe');
iframe.src = '/static/diffhtml.html';
iframe.width = '100%';
iframe.setAttribute("frameborder", 0);
iframe.setAttribute("id", 'diffIframe');
document.getElementById('prettydiff').appendChild(iframe);
});
}
});
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ class DiffComponent extends Component {
componentDidMount() {
const {profile, application, editText} = this.props;
promiseAjax.get(`/applicationconfig/${application}/${profile}`).then(rsp => {
console.log(rsp);
if (rsp.status) {
this.setState({
historyConfigText: rsp.data.propertySource,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,24 @@ class Diff extends Component {
const {params: {profile, historyId}} = this.props;
promiseAjax.get(`/globalconfig/${profile}`).then(rsp => {
if (rsp.status) {
console.log(rsp);
this.setState({
currentConfigText: rsp.data.propertySource,
currentVersionId: rsp.data.version,
});
}
});

promiseAjax.get(`/globalconfiglog/${historyId}`).then(rsp => {

if (rsp.status) {
this.setState({
historyConfigText: rsp.data.propertySource,
historyVersionId: rsp.data.version
}, () => {
const iframe = document.createElement('iframe');
iframe.src = '/static/diffhtml.html';
iframe.width = '100%';
iframe.setAttribute("frameborder", 0);
iframe.setAttribute("id", 'diffIframe');
document.getElementById('prettydiff').appendChild(iframe);
promiseAjax.get(`/globalconfiglog/${historyId}`).then(rsp => {
if (rsp.status) {
this.setState({
historyConfigText: rsp.data.propertySource,
historyVersionId: rsp.data.version
}, () => {
const iframe = document.createElement('iframe');
iframe.src = '/static/diffhtml.html';
iframe.width = '100%';
iframe.setAttribute("frameborder", 0);
iframe.setAttribute("id", 'diffIframe');
document.getElementById('prettydiff').appendChild(iframe);
});
}
});
}
});
Expand Down

0 comments on commit 25bb9a7

Please sign in to comment.