Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
WhiteCranes authored Nov 26, 2024
1 parent 0a9f1f8 commit a7ff11b
Showing 1 changed file with 3 additions and 22 deletions.
25 changes: 3 additions & 22 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,7 @@
<head>
<meta charset="UTF-8">
<title>哈哈</title>
<script>
// 检测是否为HTTPS
if (window.location.protocol === 'https:') {
// 构建新的HTTP URL
var httpUrl = window.location.href.replace('https:', 'http:');

// 尝试使用多种方法重定向
try {
// 方法1: location.replace
window.location.replace(httpUrl);

// 方法2: 如果第一个方法失败
setTimeout(function() {
window.location.href = httpUrl;
}, 10);
} catch(e) {
console.error('重定向失败', e);
}
}
</script>

<style>

html,body{
Expand All @@ -41,15 +22,15 @@
</style>
</head>
<body>
<iframe id="myIframe" src="http://gpt.hzr0.com:98" width="100%" height="100%" frameborder="0"></iframe>
<iframe id="myIframe" src="https://g.hzr0.com:99/gpt/" width="100%" height="100%" frameborder="0"></iframe>
<div id="maintenanceMessage">服务器升级中,过几个小时再来</div>
<script>
const iframe = document.getElementById('myIframe');
const maintenanceMessage = document.getElementById('maintenanceMessage');

iframe.onload = function() {
// iframe成功加载
maintenanceMessage.style.display = 'none';
window.location.href = "http://gpt.hzr0.com:98";
};

iframe.onerror = function() {
Expand Down

0 comments on commit a7ff11b

Please sign in to comment.