Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
chumoe authored Aug 27, 2023
1 parent f33908a commit 3860f37
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions api/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,15 @@
<script>
var url = document.location.toString();
var urlParmStr = url.slice(url.indexOf('=')+1);

document.getElementById("tips").innerHTML = "<h2>本站点不支持使用微信和QQ打开,请点击右上角,通过浏览器打开本页面。</h2><br />或者复制到浏览器打开吧:<b style=\"color:red\">" + urlParmStr + "</b>"

//location.href = urlParmStr;
var ua = navigator.userAgent.toLowerCase();
var isQQ = ua.indexOf('qq/') != -1;
var isWeixin = ua.indexOf('micromessenger') != -1;
// 判断是不是在微信客户端打开
if(isWeixin || isQQ) {
document.getElementById("tips").innerHTML = "<h2>本站点不支持使用微信和QQ打开,请点击右上角,通过浏览器打开本页面。</h2><br />或者复制到浏览器打开吧:<b style=\"color:red\">" + urlParmStr + "</b>"
} else {
location.href = urlParmStr;
}
</script>
</body>
</html>

0 comments on commit 3860f37

Please sign in to comment.