diff --git a/index.html b/index.html index fa11c62..1d228b3 100644 --- a/index.html +++ b/index.html @@ -572,7 +572,7 @@
-   +  
© 2019 ✨小透明・宸✨
@@ -713,7 +713,7 @@

开源就是好

var xhr = new XMLHttpRequest; xhr.open('GET', 'https://i.akarin.dev/misc/get_article_info.php?url=' + encodeURIComponent(value)); //获取标题和封面的服务器 xhr.onreadystatechange = function () { - if (xhr.readyState == 4) { + if (xhr.readyState == 4 && xhr.status == 200) { var result = JSON.parse(xhr.responseText); document.getElementById('requestAction').innerText = 'OK'; @@ -729,6 +729,9 @@

开源就是好

document.getElementById('requestResultContent').innerHTML = '输入的链接是否为微信公众号文章?
(链接通常以 https://mp.weixin.qq.com/ 作为开头)'; } } + } else { + document.getElementById('requestResult').innerText = '获取失败!( ´_っ`)'; + document.getElementById('requestResultContent').innerHTML = '无法连接到服务器。'; } requestDialog.handleUpdate(); }