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;
|
||||
}
|
||||
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') {
|
||||
links.forEach(link => (link.style.display = 'block'));
|
||||
}
|
||||
});
|
||||
}
|
||||
componentWillUnmount() {
|
||||
clearTimeout(this.pingTimer);
|
||||
}
|
||||
getArticle(article) {
|
||||
const { content } = this.props;
|
||||
const { meta } = content;
|
||||
|
@ -49,5 +49,5 @@ export function ping(url, callback) {
|
||||
img.onload = () => finish('responded');
|
||||
img.onerror = () => finish('error');
|
||||
img.src = url;
|
||||
setTimeout(() => finish('timeout'), 1500);
|
||||
return setTimeout(() => finish('timeout'), 1500);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user