From 56d23037017590d8ce532c2a782932d4dd0099e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=A8=E5=B0=8F=E9=80=8F=E6=98=8E=E3=83=BB=E5=AE=B8?= =?UTF-8?q?=E2=9C=A8?= <1272742391@qq.com> Date: Sat, 24 Aug 2019 01:00:27 +0800 Subject: [PATCH] Update index.html --- index.html | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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(); }