mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-01 11:39:28 +08:00
fix timeout error
This commit is contained in:
parent
ae3d009ff6
commit
def3d60069
@ -14,12 +14,15 @@ export default class Article extends React.Component {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const checkImgUrl = 'http://alipay-rmsdeploy-dev-image.oss-cn-hangzhou-zmf.aliyuncs.com/rmsportal/JdVaTbZzPxEldUi.png';
|
const checkImgUrl = 'http://alipay-rmsdeploy-dev-image.oss-cn-hangzhou-zmf.aliyuncs.com/rmsportal/JdVaTbZzPxEldUi.png';
|
||||||
utils.ping(checkImgUrl, status => {
|
this.pingTimer = utils.ping(checkImgUrl, status => {
|
||||||
if (status === 'responded') {
|
if (status === 'responded') {
|
||||||
links.forEach(link => (link.style.display = 'block'));
|
links.forEach(link => (link.style.display = 'block'));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
componentWillUnmount() {
|
||||||
|
clearTimeout(this.pingTimer);
|
||||||
|
}
|
||||||
getArticle(article) {
|
getArticle(article) {
|
||||||
const { content } = this.props;
|
const { content } = this.props;
|
||||||
const { meta } = content;
|
const { meta } = content;
|
||||||
|
@ -49,5 +49,5 @@ export function ping(url, callback) {
|
|||||||
img.onload = () => finish('responded');
|
img.onload = () => finish('responded');
|
||||||
img.onerror = () => finish('error');
|
img.onerror = () => finish('error');
|
||||||
img.src = url;
|
img.src = url;
|
||||||
setTimeout(() => finish('timeout'), 1500);
|
return setTimeout(() => finish('timeout'), 1500);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user