Spaces:
Running
Running
File size: 1,705 Bytes
3e3ff00 |
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 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="./vue.min.js"></script>
</head>
<body>
<script charset="UTF-8" id="LA_COLLECT" src="//sdk.51.la/js-sdk-pro.min.js"></script>
<script>LA.init({id:"JriYR23pld0itc3w",ck:"JriYR23pld0itc3w"})</script>
<script>
// 判断设备类型并返回对应的跳转URL 这个不知道为啥vercel不稳定
function getRedirectUrl(userAgent) {
const bitvpn_all_link = 'https://wwf.lanzoue.com/b03fnqqla'
const deviceMap = new Map([
['android', bitvpn_all_link],
['iphone', bitvpn_all_link],
['ipad', bitvpn_all_link],
['ipod', bitvpn_all_link],
['ios', bitvpn_all_link],
['macintosh', bitvpn_all_link],
['mac', bitvpn_all_link],
['windows', bitvpn_all_link],
['linux', bitvpn_all_link]
]);
for (const [device, redirectUrl] of deviceMap) {
const deviceParts = device.split(' '); // Split the device key into parts
let allPartsMatch = true;
// Check if all parts of the device key are present in the user agent
for (const part of deviceParts) {
if (!userAgent.includes(part)) {
allPartsMatch = false;
break;
}
}
if (allPartsMatch) {
return redirectUrl;
}
}
return androidLink; // 默认跳转URL
}
new Vue({
created() {
const userAgent = navigator.userAgent.toLowerCase();
const redirectUrl = getRedirectUrl(userAgent);
if (redirectUrl) {
window.location.href = redirectUrl; // 跳转到不同域名的页面
}
}
});
</script>
</body>
</html>
|