-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
96 lines (85 loc) · 2.71 KB
/
index.html
File metadata and controls
96 lines (85 loc) · 2.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>页面跳转中...</title>
<style>
body {
font-family: Arial, sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
background-color: #f5f5f5;
}
.container {
text-align: center;
padding: 20px;
background: white;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
.loading {
display: inline-block;
width: 50px;
height: 50px;
border: 3px solid #f3f3f3;
border-top: 3px solid #3498db;
border-radius: 50%;
animation: spin 1s linear infinite;
margin: 20px 0;
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
</style>
</head>
<body>
<div class="container">
<h2>页面正在跳转中...</h2>
<div class="loading"></div>
<p id="message">正在准备跳转,请稍候...</p>
</div>
<script>
// 获取URL参数
function getUrlParameter(name) {
name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
var regex = new RegExp('[\\?&]' + name + '=([^&#]*)');
var results = regex.exec(location.search);
return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
}
// 获取jump参数
const jumpUrl = getUrlParameter('jump');
// 验证URL格式
function isValidUrl(string) {
try {
new URL(string);
return true;
} catch (_) {
return false;
}
}
// 执行跳转
if (jumpUrl) {
// 直接使用提供的URL,不做任何修改
if (isValidUrl(jumpUrl)) {
document.getElementById('message').textContent = `即将跳转到: ${jumpUrl}`;
setTimeout(() => {
window.location.href = jumpUrl;
}, 1500);
} else {
document.getElementById('message').textContent = '无效的跳转地址!';
}
} else {
document.getElementById('message').textContent = '未找到跳转地址!';
}
</script>
</body>
</html>